Part Number Hot Search : 
06TCM2 2SB1427 CB2518 AON2810 EL1529 S93WD663 BR20100 FDP070AN
Product Description
Full Text Search
 

To Download MAXQ3108 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  general description the MAXQ3108 is a low-power microcontroller that fea-tures two high-performance maxq20 cores: a dedicat- ed core (dspcore) for intensive data processing and a user core (usercore) for supervisory functions. the two cores can operate at different clock speeds, allowing lower system power consumption for even processing intensive applications. the usercore can be configured to run at the lowest clock rate possible for monitoring the peripherals for communication activities, while the dspcore runs at the highest speed. each core has access to an independent math accelerator (a multi- ply/accumulate unit). the usercore supports spi, i 2 c, two uart channels with one channel supporting ir carrier modulation, a trimmable real-time clock(rtc), battery-backed rtc registers, and data memo- ry. the dspcore is fully user programmable and con- figurable. with the standard 32,768hz crystal, the dspcore operates at 10.027mhz, while the usercore runs at 5.014mhz. applications electricity metersindustrial control battery-powered and portable devices smart transmitters medical instrumentation features ? high-performance, low-power, dual 16-bit risccores ? approaches 1mips per mhz ? system clock 10.027mhz (dspcore)5.014mhz (usercore) ? 33 instructions ? approximately 100ns execution time at 10.027mhz ? three independent data pointers accelerate datamovement with automatic increment/decrement ? 16-bit instruction word, 16-bit data bus ? 16 x 16-bit general-purpose working registersfor each core ? 16-level hardware stack for each core ? hardware support for software stack ? memory features usercore 64kb flash program memory16b battery-backed (v bat ) data sram 4kb utility rom2kb data sram; 10kb total data sram (if dspcore inactive) dspcore 8kb user-loadable sram code memory1kb data sram ? peripherals fll (10mhz output with 32khz input)spi master, i 2 c master two uart channels (one supports ir carrier modulation) math accelerator for each corethree manchester decoder and cubic sinc filter channels for interfacing to ds8102 delta-sigmamodulators two 16-bit programmable timer/countersrtc with alarms and digital trim, dedicated battery-backup pin (v bat ) two programmable pulse generatorsindependent watchdog timer for each core external interrupts jtag interface ? operating modes stop mode: 0.1? typactive current at 10mhz and v dd = 2.0v: 1.0ma typ MAXQ3108 low-power, dual-core microcontroller ________________________________________________________________ maxim integrated products 1 ordering information rev 0; 1/09 for pricing, delivery, and ordering information, please contact maxim direct at 1-888-629-4642, or visit maxim? website at www.maxim-ic.com. note: some revisions of this device may incorporate deviations from published specifications known as errata. multiple revisions of any device may be simultaneously available through various sales channels. for information about device errata, go to: www.maxim-ic.com/errata . + denotes a lead(pb)-free/rohs-compliant package. part temp range pin-package MAXQ3108-ffn+ -40c to +85c 28 tssop pin configuration appears at end of data sheet. spi is a trademark of motorola, inc. maxq is a registered trademark of maxim integrated products, inc. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 2 _______________________________________________________________________________________ absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 recommended dc operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 microprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 dsp program ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 system registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 peripheral registers?sercore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 peripheral registers?spcore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 special function register bit descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 32,768hz crystal oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 frequency-locked loop (fll) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 power conservation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 power-management mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 switchback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 power-on reset/brownout reset generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 watchdog timer reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 external reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 reset input pin disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 peripheral devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 gpio ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 uarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 infrared support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 i 2 c interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 adc inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 adc registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 table of contents downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller _______________________________________________________________________________________ 3 figure 1. memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 figure 2. ir option on uart 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 figure 3. adc bit stream decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 figure 4. connecting the MAXQ3108 to a ds8102 dual delta-sigma modulator . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 table 1. usercore peripheral registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 table 2. usercore peripheral register default values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 table 3. dspcore peripheral registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 table 4. dspcore peripheral register default values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 table 5. multipurpose pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 table 6. MAXQ3108 clock divisors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 list of figures list of tables dual-core interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 dsp code memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 intercore communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 timer 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 timer b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 timer b use-case scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 multiply-accumulate unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 programmable pulse generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 in-application flash programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 development and technical support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 additional documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 table of contents (continued) downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 4 _______________________________________________________________________________________ recommended dc operating conditions(v dd = v rst to 3.6v, t a = -40? to +85?.) (notes 1, 2) stresses beyond those listed under ?bsolute maximum ratings?may cause permanent damage to the device. these are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. voltage range on any pin except v dd with respect to v ss ...........................-0.3v to v dd voltage range on v dd with respect to v ss .........-0.3v to +3.6v operating temperature range ...........................-40? to +85? storage temperature range .............................-65? to +150? soldering temperature...........................refer to the ipc/jedec j-std-020 specification. parameter symbol conditions min typ max units supply voltage v dd v rst 3.6 v power-fail reset voltage v rst monitors v dd 1.875 1.975 v 1.8v internal regulator v reg18 1.71 1.8 1.89 v 1.8v power-fail reset voltage v regrst monitors regout 1.62 1.71 v battery supply voltage v bat 1.8 3.6 v v dd = 0, v bat = 3.6v, 32khz oscillator and rtc enabled 0.8 battery current (note 3) i bat1 v dd = 0, v bat = 2v, 32khz oscillator and rtc enabled 0.6 a i dd_fll1 /1 mode, v dd = 2.0v 1.3 2.2 i dd_fll2 /1 mode, v dd = 3.6v 1.5 2.5 i dd_fll9 pmm2 (32khz), v dd = 2.0v 0.5 0.8 active current with 32.768khz crystal connected to cx1, cx2; fll selected (10mhz output); endsp = 0; all decimators and sinc filters off (note 4) i dd_fll10 pmm2 (32khz), v dd = 3.6v 0.6 1.0 ma i dd_fll14 v dd = 2.0v 1.0 1.7 active current with 32.768khz crystal connected to cx1, cx2; fll selected (10mhz output); usercore = /256 pmm; dspcore = /1 ; endsp = 1; manchester decoders on; decimators on i dd_fll15 v dd = 3.6v 1.8 3.0 ma i stop_1 bod = 1, regen = 0, svmstop = 0, rtc off (lowest current stop mode) 0.1 2.4 stop-mode current (note 5) i stop_2 bod = 0, regen = 0, svmstop = 0, rtc off (adds brownout-reset detection) 30 125 a input low (cx1) v il1 v ss 0.20 x v dd v input low (all other pins) v il2 v ss 0.30 x v dd v input high (cx1) v ih1 0.75 x v dd v dd v input high (all other pins) v ih2 0.70 x v dd v dd v input hysteresis (schmitt) v ihys 0.18 v output low (all port pins) v ol i ol = 4ma (note 6) v ss 0.4 v output high (all port pins) v oh i oh = -4ma (note 6) v dd - 0.4 v absolute maximum ratings downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller _______________________________________________________________________________________ 5 recommended dc operating conditions (continued) (v dd = v rst to 3.6v, t a = -40? to +85?.) (notes 1, 2) parameter symbol conditions min typ max units input/output pin capacitance c io guaranteed by design 15 pf input low current all pins i il v in = 0.4v -30 a input-leakage current i l internal pullup disabled -100 +100 na input pullup resistor (all inputs) r pu 60 k  clock source fll output frequency f fll cx1 = 32.768khz 9.5 10.0 10.5 mhz fll output accuracy  f fll cx1 = 32.768khz 1.5 5 % flash memory system clock during flash programming/erase 2 mhz mass erase 22.8 24 25.2 flash erase time page erase 22.8 24 25.2 ms flash programming time per word (note 7) 59.5 66.5 s write/erase cycles 1000 cycles data retention t a = +25 c 100 years supply voltage monitor set point sv tr 2.0 3.5 v increment resolution 0.1 v default set point 2.7 v current consumption i svm 10 a start time t svmst 200 s setup time (change set point) t svm_su1 changing from one set point to another set point 2 s setup time (stop mode exit) t svm_su2 exit from stop mode 8 s real-time clock rtc input frequency f 32kin 32khz watch crystal 32,768 hz v dd = 2.0v 0.6 rtc operating current i rtc v dd = 3.6v 0.8 a note 1: results based on simulation data. characterization data will be available at a later date. all voltages are referenced toground. specifications to t a = -40? are guaranteed by design and are not production tested. note 2: typical values are not guaranteed. these values are measured at room temperature, v dd = 3.3v. note 3: this current is from v bat only if (v dd < v bat and v dd < v rst ) or (stop = 1, regen = 0, bod = 1). otherwise, this current is from v dd . note 4: measured on the v dd pin and the device not in reset. all inputs are connected to v ss or v dd . outputs do not source/sink any current. timer enabled, rtc enabled, part executing jump $ from flash. note 5: if the rtc is on for parameters istop_2, istop_3, and istop_4, a current equal to i bat1 is added to i dd . note 6: the maximum total current, i oh(max) and i ol(max) , for all outputs combined should not exceed 35ma to satisfy the maxi- mum specified voltage drop. note 7: the timing listed above is clocked by 63 cycles of the internal 1mhz ?% clock. there will be rom code overhead, which isa function of system clock. for data sheet purposes, a better way is to specify the limits that include rom code execution with specified system clock speed. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 6 _______________________________________________________________________________________ MAXQ3108 sinc3 filter v 0 sinc3 filter manchester decoder 24-bit result pulse generator p2.5/cf1 24-bit result i 0 pulse generator p2.6/cf2 maxq20 dspcore 4kw sram (code) 512w sram (data) maxq20 administrative core 32kw flash (code) 2kw rom (code) 1kw sram (data) multiply- accumulate unit regout p1.6/rst v bat clk sinc3 filter v 1 sinc3 filter manchester decoder 24-bit result 24-bit result i 1 clk sinc3 filter v 2 sinc3 filter manchester decoder 24-bit result 24-bit result multiply- accumulate unit p2.4/mdin0p i 2 i 2 c master clk spi p2.3/mdin0n/ssel p2.2/sclk/clko p2.1/mdin2n/miso p2.0/mdin2p/mosi v dd gnd cx1 cx2 jtag p1.0/tms p1.1/tck p1.2/tdi p1.3/tdo/sqw p1.5/tba p1.4/tbb usart p0.7/rxd1 p0.6/txd1 gpio p1.5/tbap1.4/tbb p0.3/mdin1p/t2pb p0.2/mdin1n/t2p mailbox comm 32khz osc rtc fll 1.8v core ldo and supply monitor timer b timer 2 usart p0.1/rxd0 p0.0/txd0 block diagram downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller _______________________________________________________________________________________ 7 pin description pin name function power pins 21 v dd supply voltage . must be bypassed with a 4.7f capacitor with esr < 5  and a 0.1f ceramic capacitor. 17 gnd ground 20 regout regulator output. 1.8v output. must be connected to a 1f low-esr (< 1  ) external ceramic chip capacitor. 19 v bat battery input for backing up the rtc clock pins 15, 16 cx1, cx2 rtc crystal inputs. the rtc requires a 32.768khz crystal to be connected in order to supply the time base for the rtc. the 6pf load capacitors are included in the ci rcuitry. i/o pins port 0. port 0 functions as both an 8-bit i/o port and as a special functio n interface to the i 2 c master and serial uarts 0 and 1. all pins support external interrup t functionality. the default reset condition of the pins is weakly pulled up (input). to drive output, either the port direction register must be programmed to enable output or the alternate function modul e must be configured to drive the pins. this port is accessible to the usercore only. pin port alternate function 2 p0.0 txd0/int0 3 p0.1 rxd0/int1 4 p0.2 mdin1n/t2p/int2 5 p0.3 mdin1p/t2pb/int3 6 p0.4 sda/int4 7 p0.5 scl/int5 23 p0.6 txd1/int6 2C7, 23, 22 p0.0Cp0.7 22 p0.7 rxd1/int7 port 1. port 1 functions as both a 6-bit i/o port and as a special function interface to the jtag compatible test access port (tap), the rtc square-wave output, and as the input/output to and from timer b. all pins support external interrupt functionality. the d efault reset condition of pins p1.0Cp1.3 is the jtag functions. to use the 4-bit port as standard gpi o, the tap must be disabled by user code. this port is accessible to the usercore only. active-low reset ( rst ). the rst pin recognizes external active-low reset inputs and employs an internal pullup resistor to allow for a combination of wired-or ex ternal reset sources. an rc is not required for power-up, as this function is provided inter nally. the rst pin function is enabled on power-on reset. it is critical that this pin not be held low ex ternally after a power-on reset or the device cannot exit the reset state. pin port alternate function 10 p1.0 tms/int8 11 p1.1 tck/int9 12 p1.2 tdi/int10 13 p1.3 tdo/sqw/int11 14 p1.4 tbb 18 p1.5 tba 10, 11, 12, 13, 14, 18, 24 p1.0Cp1.6 24 p1.6 rst downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 8 _______________________________________________________________________________________ detailed description the MAXQ3108 microcontroller is an integrated, low-cost solution to simplify the design of electricity meter- ing and industrial control products. standard features include two highly optimized, single-cycle, maxq 16-bit risc microcontroller cores; 64kb of flash memory, 11kb ram, and independent hardware stacks; gener- al-purpose registers; and data pointers for each core. application-specific peripherals include hardware spi and i 2 c masters, real-time clock, programmable pulse generators, dual uarts (one of which that supports ircarrier frequency modulation), and math accelerators. at the heart of the MAXQ3108 are two maxq20 16-bit risc microcontrollers. the dual-core approach allows one core (dspcore) to be entirely dedicated to collec- tion and processing of afe samples for the metering function, while the second core handles any communi- cation and user-specific administrative functions. the MAXQ3108 dspcore operates at 10.027mhz with the default crystal and almost all instructions execute in a single clock cycle (100ns), while the usercore runs at half that frequency (5.014mhz). the dual-core strategy promotes flexibility by allowing the update of metering routines and parameters sepa- rately in dspcore code and data memory. furthermore, an independent dspcore solely responsible for accu- rate metering introduces a measure of safety and relia- bility since all administrative/communication functions and interruptions are handled by the usercore. both cores feature standard maxq power-saving system clock-divide modes and independently implement low-power stop (usercore) and idle (dspcore) modes. the dspcore implements an idle mode that allows cpu execution to be halted while awaiting an adc sample. the usercore implements an ultra-low-power stop mode that automatically disables the dspcore and results in a quiescent current consumption of less than 1.5 a. the combination of high performance and core- specific low-power mode implementation providesincreased power efficiency and capability over compet- itive microcontrollers. microprocessor the maxq20 is a low-power implementation of the new16-bit maxq family of risc cores. the core supports the harvard memory architecture with separate 16-bit program and data address buses, but also provides pseudo-von neumann support through utility rom functions. a fixed 16-bit instruction is standard, but data can be arranged in 8 or 16 bits. the maxq20 core is implemented as a nonpipelined processor with single clock-cycle instruction execution. the data path is implemented around register modules, and each regis- ter module contributes specific functions to the core. the accumulator module consists of sixteen 16-bit reg- isters and is tightly coupled to the arithmetic logic unit (alu). program flow is supported by a dedicated 16- level-deep hardware stack. execution of instructions is triggered by data transfer between functional register modules, or between a functional register module and memory. since data pin description (continued) pin name function port 2. port 2 functions as both a 7-bit i/o port and as a special function interface to the cf pulse generator outputs, clock output, and the manchester endec or spi. the default r eset condition of the pins is weakly pulled up (input), with exception of p2.5 and p2. 6, which are always outputs and default to strong high. to drive output, either the port direction regist er must be programmed to enable output, or the alternate function module must be configured to driv e the pins. p2.5 and p2.6 are accessible to the dspcore only. pin port alternate function 1 p2.0 mdin2p/mosi 28 p2.1 mdin2n/miso 27 p2.2 sclk/clko 26 p2.3 mdin0n/ ssel 25 p2.4 mdin0p 8 p2.5 cf1 1, 28, 27, 26, 25, 8, 9 p2.0Cp2.6 9 p2.6 cf2 downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller _______________________________________________________________________________________ 9 movement involves only source and destination mod-ules, circuit switching activities are limited to active modules only. for power-conscious applications, this approach localizes power dissipation and minimizes switching noise. the modular architecture also provides maximum flexibility and reusability, which are important for a microprocessor used in embedded applications. the maxq instruction set is designed to be highly orthogonal. all arithmetical and logical operations can use any register along with the accumulator. data move- ment is supported from any register to any other regis- ter. memory is accessed through specific data pointer registers with auto increment/decrement support. memory the MAXQ3108 supports a pseudo-von neumannmemory structure that can merge program and data into a linear memory map. this is accomplished by mapping the data memory into the program space or mapping the program memory segment into the data space. memory access is under the control of the memory man- agement unit (mmu). during flash programming, the mmu maps the flash memory into data space, and the built-in firmware provides necessary controls to the embedded flash memory for all read/erase/write opera-tions when the rom loader is invoked. additionally, when the dspcore is disabled, all its code sram (8kb) is mapped into the data sram space of the usercore. this allows streamlined reconfiguration of the dsp code memory or a larger data sram for applications not employing dspcore operation. the MAXQ3108 incorporates the following: 4kb utility rom 64kb program flash 2kb sram data memory 8kb program sram (dspcore) 1kb sram data memory (dspcore) the mmu operates automatically and maps data mem- ory as a function of the contents of the instruction point- er; that is, the execution location controls the structure of the data memory map. the only constraint is that no memory region is available as data when code is being fetched from that region. for example, when executing from flash, flash cannot be read as data. but changing the execution location to the utility rom through a sub- routine call allows the flash memory to be read as data. code data when executing from utility rom data when executing from flash data when executing from ram ram 0.5kw ram 0.5kw 0xa8000xa000 0x80000x0000 utility rom 2kw 0xa000 0x80000x0000 0x0800 ram 0.5kw 0x0000 0x0000 0x0800 0x8000 utility rom 2kw 0xa000 0x8000 utility rom 2kw flash 32kw flash 32kw flash 32kw figure 1. memory map downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 10 ______________________________________________________________________________________ dsp program ram a 4k word (8kb) section of memory is available to thedspcore as code memory. when the dspcore is dis- abled (as it is immediately following a reset event) that block of memory appears in the usercore data memory map at location 0x1000. thus, a typical startup sequence to operate both cores might include: 1) low-level initialization of the usercore. 2) copy dsp code from program flash to dspcore code ram at 0x1000. 3) enable dspcore. 4) poll mailbox registers to verify that dspcore is cor- rectly running. for more information, see the dual-core interfaces section. registers the maxq family of microcontrollers uses a bank ofregisters to access memory and peripherals and to per- form basic cpu activities. these registers are orga- nized into as many as 16 register modules, each of which can have as many as 32 registers, giving a sys- tem maximum of 512 registers. the registers are divid- ed into two sections: system registers (modules 7 to 15) and peripheral registers (modules 0 to 5). since the MAXQ3108 contains two maxq core proces- sors, each has a set of system registers and a set of peripheral registers. system registers the MAXQ3108 usercore implements the standard setof system registers as described in the maxq family user? guide . the exceptions are listed below: in the imr register, bit im5 is not implemented since there is no module 5 implemented in the MAXQ3108. in the sc register, bits cda1 and upm are not imple- mented since the size of the memory in the devicedoes not require their implementation. in the iir register, bit ii5 is not implemented since there is no module 5 implemented in the MAXQ3108. in the ckcn register, bits xt/ rc , rgsl, and rgmd are not implemented. instead, bits 5 and 6are fllmd and fllsl, respectively. these bits support the frequency-locked loop (fll) that forms a core part of the MAXQ3108 clocking scheme. more information is given in the clock section. the MAXQ3108 dspcore system register complementis identical to that found in the usercore, with these exceptions: in the imr register, only im0 is implemented. the system control (sc) register is not implemented. in the iir register, only the ii0 bit is implemented. the wdcn register is not implemented because there is no watchdog timer in the dspcore.watchdog functionality can be implemented in the usercore by determining if the dspcore is respond- ing to messages. in the ckcn register, the stop, rgsl, and swb bits are not implemented because the correspondingfunctions do not exist in the dspcore. the fllmd and fllsl bits are not implemented because a com- mon clock block is shared with the usercore, and the control bits here would be redundant. peripheral registers?sercore the MAXQ3108 usercore exposes its peripheral com-plement in five modules numbered 0 to 4. table 1 describes the functions associated with the peripheral registers, and table 2 shows the default values of these registers. bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ad0 0:0 adc0 output register ad1 0:1 adc1 output register ad2 0:2 adc2 output register ad3 0:3 adc3 output register ad4 0:4 adc4 output register ad5 0:5 adc5 output register srsp0 0:6 rspsdv reqe rspst srsp1 0:7 slave response register 1 ad0lsb 0:8 adc0 output register lsb table 1. usercore peripheral registers downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 11 bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ad1lsb 0:9 adc1 output register lsb ad2lsb 0:10 adc2 output register lsb ad3lsb 0:11 adc3 output register lsb ad4lsb 0:12 adc4 output register lsb ad5lsb 0:13 adc5 output register lsb mreq0 0:14 reqcdv rspie reqcm mreq1 0:15 master request register 1 mreq2 0:16 master request register 2 adcn 0:17 ifcsel if54e if32e if10e mdcks md2e md1e md0e osr abf5 abf4 abf3 abf2 abf1 abf0 adcc 0:18 adc clock correction register mstc 0:19 ccsl md2snc md1snc md0snc po0 1:0 port 0 output register po1 1:1 port 1 output register pi0 1:2 port 0 input register pi1 1:3 port 1 input register eif0 1:4 port 0 interrupt flag register eie0 1:5 port 0 interrupt enable register eif1 1:6 port 1 interrupt flag register eie1 1:7 port 1 interrupt enable register pd0 1:8 port 0 direction register pd1 1:9 port 1 direction register eies0 1:10 port 0 external interrupt edge select eies1 1:11 port 1 external interrupt edge select svm 1:12 svth svmstop svmi svmie svmrdy svmen fcntl 1:13 fbusy fc fdata 1:14 flash data register pwcn 1:15 endsp bod regen rstd eclko flock fllen bb0 1:16 battery-backed general-purpose storage 0 bb1 1:17 battery-backed general-purpose storage 1 bb2 1:18 battery-backed general-purpose storage 2 bb3 1:19 battery-backed general-purpose storage 3 bb4 1:20 battery-backed general-purpose storage 4 bb5 1:21 battery-backed general-purpose storage 5 bb6 1:22 battery-backed general-purpose storage 6 bb7 1:23 battery-backed general-purpose storage 7 rtrm 1:24 tsgn trm rcnt 1:25 we x32d 32krdy 32kbyp 32kmd ft sqe alsf aldf rdye rdy busy ase ade rtce rtss 1:26 rtc subsecond counter rtsh 1:27 rtc seconds register msw rtsl 1:28 rtc seconds register lsw rssa 1:29 rtc subsecond alarm rash 1:30 rtc seconds alarm msw rasl 1:31 rts seconds alarm lsw t2cna 2:0 et2 t2oe0 t2pol0 tr2l tr2 cprl2 ss2 g2en t2h 2:1 timer 2 msb table 1. usercore peripheral registers (continued) downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 12 ______________________________________________________________________________________ bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 t2rh 2:2 timer 2 msb reload value t2ch 2:3 timer 2 msb capture/compare value po2 2:4 port 2 output register pi2 2:5 port 2 input register scon0 2:6 sm0/ fe sm1 sm2 ren tb8 rb8 ti ri sbuf0 2:7 serial data buffer 0 smd0 2:8 epwm ofs esi smod fede pr0 2:9 phase register 0 pd2 2:10 port 2 direction register t2cnb 2:11 et2l t2oe1 t2pol1 tf2 tf2l tcc2 t2cl t2v 2:12 timer 2 value register t2r 2:13 timer 2 reload register t2c 2:14 timer 2 capture/compare register t2cfg 2:15 t2ci t2div t2md ccf c/ t2 mcnt 3:0 of mcw cld squ opcs msub mmac sus ma 3:1 multiplier operand a register mb 3:2 multiplier operand b register mc2 3:3 multiplier accumulator register 2 (msb, bits 47-32) mc1 3:4 multiplier accumulator register 1 (bits 31-16) mc0 3:5 multiplier accumulator register 0 (lsb, bits 15-0) spib 3:7 spi data buffer mc1r 3:8 multiplier read register 1 (msb, bits 31-16) mc0r 3:9 multiplier read register 0 (lsb, bits 15-0) spicn 3:13 stby spic rovr wcol modf modfe mstm spien spicf 3:14 espii chr ckpha ckpol spick 3:15 spi clock register i2cbuf 4:0 i 2 c data buffer register i2cst 4:1 i2cbus i2cbusy i2cspi i2cscl i2croi i2cgci i2cnacki i2cali i2cami i2ctoi i2cstri i2cr xi i2ctxi i2csri i2cie 4:2 i2cspie i2croie i2cgcie i2cnackie i2calie i2camie i2ctoie i2cstrie i2crxie i2c txie i2csrie tb0r 4:4 timer b capture/reload value tb0c 4:5 timer b compare value scon1 4:6 sm0/ fe sm1 sm2 ren tb8 rb8 ti ri sbuf1 4:7 serial data buffer 1 smd1 4:8 esi smod fede pr1 4:9 phase register 1 tb0cn 4:10 c/ t b tbcs tbcr tbps tfb exfb tboe dcen exenb trb etb cp/ rlb tb0v 4:11 timer b value register i2ccn 4:12 i2crst i2cstren i2cgcen i2cstop i2cstart i2cack i2cstrs i2cmode i2cmst i2cen i2cck 4:13 i 2 c clock high period i 2 c clock low period i2cto 4:14 i 2 c timeout period i2csla 4:15 i 2 c slave address table 1. usercore peripheral registers (continued) downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 13 bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ad0 0:0 0xffff ad1 0:1 0xffff ad2 0:2 0xffff ad3 0:3 0xffff ad4 0:4 0xffff ad5 0:5 0xffff srsp0 0:6 0 0 0x0 srsp1 0:7 0x0000 ad0lsb 0:8 0xff ad1lsb 0:9 0xff ad2lsb 0:10 0xff ad3lsb 0:11 0xff ad4lsb 0:12 0xff ad5lsb 0:13 0xff mreq0 0:14 0 0 0x0 mreq1 0:15 0x0000 mreq2 0:16 0x0000 adcn 0:17 0 0 0 0 0 0 0 0 0x0 0 0 0 0 0 0 adcc 0:18 0x 0000 mstc 0:19 0x3 0 0 0 po0 1:0 0xff po1 1:1 0x7f pi0 1:2 0xxx pi1 1:3 0xxx eif0 1:4 0x00 eie0 1:5 0x00 eif1 1:6 0x0 eie1 1:7 0x0 pd0 1:8 0x00 pd1 1:9 0x00 eies0 1:10 0x00 eies1 1:11 0x0 svm 1:12 0x7 0 0 0 0 0 fcntl 1:13 1 0x0 fdata 1:14 0x0000 pwcn 1:15 0 0 0 0 0 0 0 bb0 1:16 0xxxxx bb1 1:17 0xxxxx bb2 1:18 0xxxxx bb3 1:19 0xxxxx bb4 1:20 0xxxxx bb5 1:21 0xxxxx bb6 1:22 0xxxxx bb7 1:23 0xxxxx rtrm 1:24 x x table 2. usercore peripheral register default values downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 14 ______________________________________________________________________________________ bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 rcnt 1:25 0 x x x 0xx 0 0 0 0 0 0 1 0 0 x rtss 1:26 0xxx rtsh 1:27 0xxxxx rtsl 1:28 0xxxxx rssa 1:29 0xxxxx rash 1:30 0xx rasl 1:31 0xxxxx t2cna 2:0 0 0 0 0 0 0 0 0 t2h 2:1 0x00 t2rh 2:2 0x00 t2ch 2:3 0x00 po2 2:4 1fh pi2 2:5 0xxx scon0 2:6 0 0 0 0 0 0 0 0 sbuf0 2:7 0x00 smd0 2:8 0 0 0 0 0 pr0 2:9 0x0000 pd2 2:10 0x00 t2cnb 2:11 0 0 0 0 0 0 0 t2v 2:12 0x0000 t2r 2:13 0x0000 t2c 2:14 0x0000 t2cfg 2:15 0 0x0 0 0x0 0 mcnt 3:0 0 0 0 0 0 0 0 0 ma 3:1 0x0000 mb 3:2 0x0000 mc2 3:3 0x0000 mc1 3:4 0x0000 mc0 3:5 0x0000 spib 3:7 0x0000 mc1r 3:8 0x0000 mc0r 3:9 0x0000 spicn 3:13 0 0 0 0 0 0 0 0 spicf 3:14 0 0 0 0 spick 3:15 0x00 i2cbuf 4:0 0x0000 i2cst 4:1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 i2cie 4:2 0 0 0 0 0 0 0 0 0 0 0 tb0r 4:4 0x0000 tb0c 4:5 0x0000 scon1 4:6 0 0 0 0 0 0 0 0 sbuf1 4:7 0x0000 smd1 4:8 0 0 0 pr1 4:9 0x0000 tb0cn 4:10 0 0 0 0x0 0 0 0 0 0 0 0 0 table 2. usercore peripheral register default values (continued) downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 15 peripheral registers?spcore the MAXQ3108 dspcore exposes its peripheral com-plement in modules numbered 0 and 1. table 3 describes the functions associated with the peripheralregisters, and table 4 shows the default values of these registers. bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 tb0v 4:11 0x0000 i2ccn 4:12 0 0 0 0 0 0 0 0 0 0 i2cck 4:13 0x02 0x04 i2cto 4:14 0x00 i2csla 4:15 0x000 table 2. usercore peripheral register default values (continued) bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ad0 0:0 adc0 output register ad1 0:1 adc1 output register ad2 0:2 adc2 output register ad3 0:3 adc3 output register ad4 0:4 adc4 output register ad5 0:5 adc5 output register srsp0 0:6 rspsdv reqe rspst srsp1 0:7 slave response register 1 ad0lsb 0:8 adc0 output register lsb ad1lsb 0:9 adc1 output register lsb ad2lsb 0:10 adc2 output register lsb ad3lsb 0:11 adc3 output register lsb ad4lsb 0:12 adc4 output register lsb ad5lsb 0:13 adc5 output register lsb mreq0 0:14 reqcdv rspie reqcm mreq1 0:15 master request register 1 mreq2 0:16 master request register 2 adcn 0:17 ifcsel if45e if23e if10e mdcks md2e md1e md0e osri abf5 abf4 abf3 abf2 abf1 abf0 adcc 0:18 adc clock correction register mstc 0:19 ccsl md2snc md1snc md0snc mcnt 1:0 of mcw cld squ opcs msub mmac sus ma 1:1 multiplier operand a register mb 1:2 multiplier operand b register mc2 1:3 multiplier accumulator register 2 (msb, bits 47-32) mc1 1:4 multiplier accumulator register 1 (bits 31-16) mc0 1:5 multiplier accumulator register 0 (lsb, bits 15-0) table 3. dspcore peripheral registers downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 16 ______________________________________________________________________________________ bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 po2 1:7 port 2 output register mc1r 1:8 multiplier read register 1 (msb, bits 31-16) mc0r 1:9 multiplier read register 0 (lsb, bits 15-0) cf1d 1:12 cf1 delay register cf2d 1:13 cf2 delay register table 3. dspcore peripheral registers (continued) bit register mod: reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ad0 0:0 0xffff ad1 0:1 0xffff ad2 0:2 0xffff ad3 0:3 0xffff ad4 0:4 0xffff ad5 0:5 0xffff srsp0 0:6 0 0 0x0 srsp1 0:7 0x0000 ad0lsb 0:8 0xff ad1lsb 0:9 0xff ad2lsb 0:10 0xff ad3lsb 0:11 0xff ad4lsb 0:12 0xff ad5lsb 0:13 0xff mreq0 0:14 0 0 0x0 mreq1 0:15 0x0000 mreq2 0:16 0x0000 adcn 0:17 0 0 0 0 0 0 0 0 0x0 0 0 0 0 0 0 adcc 0:18 0x0000 mstc 0:19 0x3 0 0 0 mcnt 1:0 0 0 0 0 0 0 0 0 ma 1:1 0x0000 mb 1:2 0x0000 mc2 1:3 0x0000 mc1 1:4 0x0000 mc0 1:5 0x0000 po2 1:7 0x0000 mc1r 1:8 0x0000 mc0r 1:9 0x0000 cf1d 1:12 0x0000 cf2d 1:13 0x0000 table 4. dspcore peripheral register default values downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 17 special function register bit descriptions register description ad0 (00h, 00h) analog-to-digital converter 0 output register initialiation: this register is reset to 0xffff on all forms of reset. read/write access: unrestricted read access. ad0.[15:0]: analog-to-digital converter 0 output register. this register contains the most significant 16 bits of the current adc0 data sample that was acquired from the respective s inc3 filter. reading from the adc0 register(s) results in the abf0 flag being cleared by ha rdware (when set), unless the read operation is performed simultaneously with a write. reading a disabled adc returns the data last acquired if the associated buffer full flag is set and returns ffffh if the flag is clear. ad1 (01h, 00h) analog-to-digital converter 1 output register ad2 (02h, 00h) analog-to-digital converter 2 output register ad3 (03h, 00h) analog-to-digital converter 3 output register ad4 (04h, 00h) analog-to-digital converter 4 output register ad5 (05h, 00h) analog-to-digital converter 5 output register srsp0 (06h, 00h) slave response register 0 initialiation: this register is reset to 00h on all forms of reset. read/write access: unrestricted read access only to the usercore (except rspsdv; s ee the bit description). unrestricted read/write access to the dspcore (except rspsdv and rspst[3:0]; see the bit descriptions). srsp0.[3:0]: rspst[3:0] response status bits 3:0. these bits can be used to report acknowledgement and status of the current command being processed by the slave and to report slave system conditions (e.g., watchdog timeout) that are not related to a master command. to notify the mast er that status is ready to be read, the rsp0dv bit should be set to 1 either by software (in t he case of command status) or, in some cases, by hardware (as for the watchdog). in cases where slave hardware sets the status bits, these bits are not writable by slave software until th e status condition has been cleared. when the dspcore watchdog timer reaches ffffh, a system interrupt from the dspcore is signaled by the setting of the srsp0.5 status flag along with the srsp0.[3:0] st atus code of 0000b. this hardware condition for the srsp0 register persists (preventing software w rites of these bits by the dspcore) until a reset of the dspcore is executed (usercore may dis able the dspcore through endsp = 0 to force the reset). srsp0.4: reqe request registers interrupt enable. setting this bit to 1 enables an interrupt for the master request-command data valid (interrupt) flag (reqcdv). the master req uest-command data valid flag is reported in mreq0.5 (and the associated command code is containe d in mreq0.[3:0]). clearing this bit to 0 disables the interrupt associated with the ma ster request-command data valid flag. srsp0.5: rspsdv response status data valid flag. this flag can only be set by the slave (dspcore) or slave hardware once a valid status or system interrupt condition is suppl ied in the rspst[3:0] field of the srsp0 register to notify the master that valid status is ready for r eading. status information or data could also be contained in srsp1, so the slave should only set this flag when all data has been loaded (included any that is loaded to srsp1). this flag can only be cleared by the master (usercore) software unless the status condition that caused har dware to set the flag persists (e.g., slave watchdog counter timeout). if made available by the slavecpu, more information can be ascertained about the status by additional master request read comm ands. srsp0.[7:6]: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 18 ______________________________________________________________________________________ special function register bit descriptions (continued) srsp1 (07h, 00h) slave response register 1 initialiation: this register is reset to 0000h on all forms of reset. read/write access: unrestricted read access only to the usercore. unrestricted read/write access to the dspcore. srsp1.[15:0]: slave response register 1 bits 15:0. these bits are used to supply output data to the master. to notify the master that data is ready to be read, the rspcdv b it should be set to 1 by software. the slave should not write further data to srsp1 until the valid condition (rspsdv = 1) is cleared by the master software. ad0lsb (08h, 00h) analog-to-digital converter 0 least significant byte o utput register initialiation: this register is reset to ffh on all forms of reset. read/write access: unrestricted read access. analog-to-digital converter 0 least significant byte output register. this register always provides read access to the least significant byte of the most current adc0 data sample acqui red from the respective sinc3 filter. see the below table for the least significant byte avail able osr options. reading from the ad0 register results in the abf0 flag being clea red by hardware (when set) unless the read operation is performed simultaneously with a wr ite. what this means is that when osr > 32, ad0lsb should be read first if the clearing of abf0 is in tended to indicate that the full result (ad0lsb and ad0) was read. reading a disabled adc returns the da ta last acquired if the associated buffer full flag is set and returns ffffh if the flag is cl ear. osr adc data output width ad0lsb format 32 16 00000000b 64 19 d2Cd0, 00000b 128 22 d5Cd0, 00b ad0lsb.[7:0]: 256 24 d7Cd0 ad1lsb (09h, 00h) analog-to-digital converter 1 least significant byte output register ad2lsb (0ah, 00h) analog-to-digital converter 2 least significant byt e output register ad3lsb (0bh, 00h) analog-to-digital converter 3 least significant byt e output register ad4lsb (0ch, 00h) analog-to-digital converter 4 least significant byt e output register ad5lsb (0dh, 00h) analog-to-digital converter 5 least significant byt e output register mreq0 (0eh, 00h) master request register 0 initialiation: this register is reset to 00h on all forms of reset. read/write access: unrestricted read/write access to the usercore (except reqcdv; see th e bit description). unrestricted read access only to the dspcore (except reqcdv; see the bit description). mreq0.[3:0]: reqcm[3:0] request command bits 3:0. these bits are written by the master to supply a command request to the slave. to notify the slave that a command is ready to be read, the req0dv bit should be set to 1. mreq0.4: rspie response registers interrupt enable. setting this bit to 1 enables an interrupt for the slave response status data valid flag (which is associated with res ponse registers 0 and 1). the status data valid (interrupt) flag is reported in srsp0.5. clearing this bit to 0 disables the interrupt associated with the response status data valid flag. mreq0.5: reqcdv request command data valid flag. this flag can only be set by the master (usercore). this flag should be set once a valid command is supplied in the reqcm [3:0] field of the mreq0 and/or data supplied in the mreq1, mreq2 registers to notify the slave that th ese registers are ready for reading. this flag can only be cleared by slave (dspcore) soft ware. mreq0.[7:6]: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 19 special function register bit descriptions (continued) mreq1 (0fh, 00h) master request register 1 initialiation: this register is reset to 0000h on all forms of reset. read/write access: unrestricted read/write access only to the usercore. unrestricted read access only to the dspcore. mreq1.[15:0]: master request register 1 bits 15:0. these bits are used to supply follow-on address and data information for commands issued by the master. to notify the slave t hat data is ready to be read, the reqcdv bit should be set to 1. the master should poll the reqcdv bit to know when the slave has read mreq1 and when it is safe to write further data to mreq1. mreq2 (10h, 00h) master request register 2 initialiation: this register is reset to 0000h on all forms of reset. read/write access: unrestricted read/write access only to the usercore. unrestricted read access only to the dspcore. mreq2.[15:0]: master request register 2 bits 15:0. these bits are used to supply follow-on address and data information for commands issued by the master. to notify the slave t hat data is ready to be read, the reqcdv bit should be set to 1. the master should poll the reqcdv bit to know when the slave has read mreq2 and when it is safe to write further data to mreq2. adcn (11h, 00h) analog-to-digital converter control register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: usercore: unrestricted read/write access except bits 0:5 are read only and 6:7 have hardware restricted write access. dspcore: read-only. adcn.0: abf0 adc0 buffer full flag. this bit is set by hardware to indicate that a sample is availa ble from adc0. an interrupt request is generated to a cpu if if01e = 1 and interr upts are not otherwise masked globally or modularly. this bit is cleared by hardware b y a cpu read (either the usercore or the dspcore) of the ad0 output register. the abf0 and abf1 flags are set in the same clock cycle. adcn.1: abf1 adc1 buffer full flag. this bit is set by hardware to indicate that a sample is availa ble from adc1. an interrupt request is generated to a cpu if if01e = 1 and interr upts are not otherwise masked globally or modularly. this bit is cleared by hardware b y a cpu read (either the usercore or the dspcore) of the ad1 output register. the abf0 and abf1 flags are set in the same clock cycle. adcn.2: abf2 adc2 buffer full flag. this bit is set by hardware to indicate that a sample is availa ble from adc2. an interrupt request is generated to a cpu if if23e = 1 and interr upts are not otherwise masked globally or modularly. this bit is cleared by hardware b y a cpu read (either the usercore or the dspcore) of the ad2 output register. the abf2 and abf3 flags are set in the same clock cycle. adcn.3: abf3 adc3 buffer full flag. this bit is set by hardware to indicate that a sample is availa ble from adc3. an interrupt request is generated to a cpu if if23e = 1 and interr upts are not otherwise masked globally or modularly. this bit is cleared by hardware b y a cpu read (either the usercore or the dspcore) of the ad3 output register. the abf2 and abf3 flags are set in the same clock cycle. adcn.4: abf4 adc4 buffer full flag. this bit is set by hardware to indicate that a sample is availa ble from adc4. an interrupt request is generated to a cpu if if45e = 1 and interr upts are not otherwise masked globally or modularly. this bit is cleared by hardware b y a cpu read (either the usercore or the dspcore) of the ad4 output register. the abf4 and abf5 flags are set in the same clock cycle. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 20 ______________________________________________________________________________________ special function register bit descriptions (continued) adcn.5: abf5 adc5 buffer full flag. this bit is set by hardware to indicate that a sample is availa ble from adc5. an interrupt request is generated to a cpu if if45e = 1 and interr upts are not otherwise masked globally or modularly. this bit is cleared by hardware b y a cpu read (either the usercore or the dspcore) of the ad5 output register. the abf4 and abf5 flags are set in the same clock cycle. oversampling rate bits 1:0. these register bits control the oversampling rate applied by all of the cubic sinc digital filters (as given in the table below). these b its are writable only when all manchester decoders are disabled. osr[1:0] oversampling rate 00b 32 01b 64 10b 128 adcn.[7:6]: osr[1:0] 11b 256 adcn.8: md0e manchester decoder 0 enable. this bit controls whether manchester decoder 0 and the two associated cubic sinc filters are enabled or disabled. when md0e is configured to logic 1, manchester decoder 0 and the associated cubic sinc filters are enabled. th is is a special case where enabling the special function input (manchester decoder input) force s a specific input mode (single-ended or differential) based upon the po bit for the port pin corres ponding to the manchester decoder positive input (e.g., po2.4 controls the single-ended or differentia l configuration for manchester decoder 0 when md0e = 1). when the po bit = 0, single-ended mode is in eff ect. when po bit = 1, differential mode is in effect. when md0e is configured to logic 0, these hardware blocks are disabled. this bit is write accessible only to the us ercore. adcn.9: md1e manchester decoder 1 enable. this bit controls whether manchester decoder 1 and the two associated cubic sinc filters are enabled or disabled. when md1e is configured to logic 1, manchester decoder 1 and the associated cubic sinc filters are enabled. th is is a special case where enabling the special function input (manchester decoder input) force s a specific input mode (single-ended or differential) based upon the po bit for the port pin corres ponding to the manchester decoder positive input (e.g., po0.3 controls the single-ended or differentia l configuration for manchester decoder 1 when md1e = 1). when the po bit = 0, single-ended mode is in eff ect. when po bit = 1, differential mode is in effect. when md1e is configured to logic 0, these hardware blocks are disabled. this bit is write accessible only to the us ercore. adcn.10: md2e manchester decoder 2 enable. this bit controls whether manchester decoder 2 and the two associated cubic sinc filters are enabled or disabled. when md2e is configured to logic 1, manchester decoder 2 and the associated cubic sinc filters are enabled. th is is a special case where enabling the special function input (manchester decoder input) force s a specific input mode (single-ended or differential) based upon the po bit for the port pin corres ponding to the manchester decoder positive input (e.g., po2.0 controls the single-ended or differentia l configuration for manchester decoder 2 when md2e = 1). when the po bit = 0, single-ended mode is in eff ect. when po bit = 1, differential mode is in effect. when md2e is configured to logic 0, these hardware blocks are disabled. this bit is write accessible only to the us ercore. adcn.11: mdcks manchester decoders clock speed select. this bit must be configured to tell the manchester decoders whether a fast or slow bit-stream sampling clock is used . when configured to 0, the decoders expect that the sampling clock is faster than the clock so urce being used by the ad02 modulator(s). when configured to 1, the decoders expect that the sampl ing clock is slower that than being used by the ad02. adcn.12: if10e adc interrupt flags 1 and 0 enable. this bit serves as the local interrupt enable for the adc cubic sinc filter output buffers 1 and 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 21 special function register bit descriptions (continued) adcn.13: if32e adc interrupt flags 3 and 2 enable. this bit serves as the local interrupt enable for the adc cubic sinc filter output buffers 3 and 2. adcn.14: if54e adc interrupt flags 5 and 4 enable. this bit serves as the local interrupt enable for the adc cubic sinc filter output buffers 5 and 4. adcn.15: ifcsel adc interrupt flag core select. this bit controls the routing and the ability to clear the adc interrupt flags. when this bit is configured to 0, the adc interrup t capability and the ability to clear the associated flags belongs to the usercore. when this bit is configur ed to 1, only the dspcore can be interrupted and has the ability to clear the interrupt fla gs. this bit is write accessible only to the usercore. adcc (12h, 00h) analog-to-digital clock correction register initialiation: this register is reset to 0000h. read/write access: unrestricted read access. adcc.[15:0]: adc clock correction value 15:0. this value reflects the count (measurement) of decoder sync bits during the predefined duration of 32khz x 2 9 clocks for the decoder selected by ccsl[1:0]. the clock correction facility is enabled on any write to the ccsl[1:0] bits (other than the 11b disable request). the adcc register reads 0000h to indicate a busy ( measuring) condition until the measurement completes, at which point, the adcc register is updated. mstc (13h, 00h) manchester decoder status register initialiation: this register is reset to 30h. read/write access: unrestricted read access. unrestricted write access to bits 5:4 (see description). mstc.0: md0snc manchester decoder 0 synchroniation status bit. this bit reflects the synchronization status of manchester decoder 0. when the decoder has achieved synchronizatio n, this bit is set to 1. when the decoder cannot or has not yet detected the required alternating synchr onization bit in the manchester bit stream, this bit is cleared to 0. once synchron ized, loss of synchronization is signaled (i.e., bit is cleared) once three sync bit errors are detected in 10 frames. if fewer than three errors are detected in 10 frames, the synchronization bit error co unter restarts on the next sync bit error. mstc.1: md1snc manchester decoder 1 synchroniation status bit. this bit reflects the synchronization status of manchester decoder 1. when the decoder has achieved synchronizatio n, this bit is set to 1. when the decoder cannot or has not yet detected the required alternating synchr onization bit in the manchester bit stream, this bit is cleared to 0. once synchron ized, loss of synchronization is signaled (i.e., bit is cleared) once three sync bit errors are detected in 10 frames. if fewer than three errors are detected in 10 frames, the synchronization bit error co unter restarts on the next sync bit error. mstc.2: md2snc manchester decoder 2 synchroniation status bit. this bit reflects the synchronization status of manchester decoder 2. when the decoder has achieved synchronizatio n, this bit is set to 1. when the decoder cannot or has not yet detected the required alternating synchr onization bit in the manchester bit stream, this bit is cleared to 0. mstc.3: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 22 ______________________________________________________________________________________ special function register bit descriptions (continued) clock correction hardware selection bits 1:0. these bits are used to enable and assign the clock measurement hardware to one of the three manchester decoders. whe n these bits are 11b, the clock measurement utility is disabled. writing these bits to any ot her state enables one clock measurement interval. when the clock measurement interval i s enabled, the adcc output register is cleared to 0000h to indicate a busy (measuring) condition. no ha rdware protection is in place to prevent attempts to measure a disabled decoder, which would result in see ing a persistent busy (adcc = 0000h) condition. the table below summarizes the measurement opt ions. separate physical implementations of these two control bits exi st for the usercore and the dspcore. the endsp bit controls which bits are used to control the cl ock correction measurement hardware. when endsp = 0, the usercore ccsl[1:0] bits control the hardwar e. when endsp = 1, the dspcore ccsl[1:0] bits control the hardware. the bits not being used by the hardware are still write accessible but have no effect on the hardware. once a clock measurement is requested, a second request should not be issued from the other core. there is no need for hardware protection against this possibility; the adcc register can be polled to ascertai n the busy status. ccsl[1:0] clock measurement (sync bit frequency) 00b decoder 0 01b decoder 1 10b decoder 2 mstc.[5:4]: ccsl[1:0] 11b disabled mstc.[7:6]: reserved reserved. reads return 0. po0 (00h, 01h) port 0 output register (8-bit register) initialiation: this register is set to 0ffh on all forms of reset. read/write access: unrestricted read/write. po0.[7:0]: port 0 output register bits 7:0. the po0 register stores output data for port 0 when it is defined as an output port and controls whether the internal weak p-channel pull up transistor is enabled/disabled if a port pin is defined as an input. the contents of this register can be modified by a write access. reading from the register returns the contents of th e register. changing the direction of port 0 does not change the data contents of the register. po1 (01h, 01h) port 1 output register (8-bit register) initialiation: this register is set to 07fh on all forms of reset. read/write access: unrestricted read/write. po1.[6:0]: port 1 output register bits 6:0. the po1 register stores output data for port 1 when it is defined as an output port and controls whether the internal weak p-channel pull up transistor is enabled/disabled if a port pin is defined as an input. the contents of this register can be modified by a write access. reading from the register returns the contents of th e register. changing the direction of port 1 does not change the data contents of the register. special note about p1.6: the rst input function remains enabled on p1.6 unless it is explicitly disabled (rstd = 1). this means that the ports control bits (pd, po) can be used to generate a reset (e.g., by driving the pin low). po1.7: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 23 special function register bit descriptions (continued) pi0 (02h, 01h) port 0 input register initialiation: the reset value for this register is dependent on the logical states of the pins. read/write access: unrestricted read-only. pi0.[7:0]: port 0 input register bits 7:0. the pi0 register always reflects the logic state of its pins when read. note that each port pin has a weak pullup circuit when functioning as an input and the p-channel pullup transistor is controlled by its respective po bits. i f the po bit is set to 1, the weak pullup is on, if the po bit is cleared to 0, the weak pullup is off and forces the port pin into three-state. pi1 (03h, 01h) port 1 input register initialiation: the reset value for this register is 0sssssssb, where s depends on the logical state of the pin. read/write access: unrestricted read. pi1.[6:0]: port 1 input register bits 6:0. the pi1 register always reflects the logic state of its pins when read. note that each port pin has a weak pullup circuit when functioning as an input and the p-channel pullup transistor is controlled by its respective po bits. i f the po bit is set to 1, the weak pullup is on, if the po bit is cleared to 0, the weak pullup is off and forces the port pin into three-state. pi1.7: reserved reserved. read returns 0. eif0 (04h, 01h) external interrupt flag 0 register initialiation: eif0 is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. eif0.[7:0]: ie[7:0] interrupt edge detect bits 7:0. these bits are set when a negative edge (itx = 1) or a positive edge (itx = 0) is detected on the interrupt x pin. setting any of the b its to 1 generates an interrupt to the cpu if the corresponding interrupt is enabled. this bit remains s et until cleared by software or a reset. it must be cleared by software before exiting the interrupt source rout ine or another interrupt is generated as long as the bit remains set. eie0 (05h, 01h) external interrupt enable 0 register initialiation: eie0 is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. eie0.[7:0]: ex[7:0] enable external interrupt bits 7:0. setting any of these bits to 1 enables the corresponding external interrupt. clearing any of the bits to 0 disables the correspond ing interrupt function. eif1 (06h, 01h) external interrupt flag 1 register initialiation: eif1 is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. eif1.[3:0]: ie[11:8] interrupt edge detect bits 11:8. these bits are set when a negative edge (itx = 1) or a positive edge (itx = 0) is detected on the interrupt x pin. setting any of the b its to 1 generates an interrupt to the cpu if the corresponding interrupt is enabled. this bit remains s et until cleared by software or a reset. it must be cleared by software before exiting the interrupt source rout ine or another interrupt is generated as long as the bit remains set. eif1.[7:4]: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 24 ______________________________________________________________________________________ special function register bit descriptions (continued) eie1 (07h, 01h) external interrupt enable 1 register initialiation: eie1 is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. eie1.[3:0]: ex[11:8] enable external interrupt bits 11:8. setting any of these bits to 1 enables the corresponding external interrupt. clearing any of the bits to 0 disables the correspond ing interrupt function. eie1.[7:4]: reserved reserved. reads return 0. pd0 (08h, 01h) port 0 direction register initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. pd0.[7:0]: port 0 direction register bits 7:0. pd0 is used to determine the direction of the port 0 function. the port pins are independently controlled by their direction bits. when a bi t is set to 1, its corresponding pin is used as an output; data in the po register is driven on the pin. when a bi t is cleared to 0, its corresponding pin is used as an input, and allows an external signal to d rive the pin. note that each port pin has a weak pullup circuit when functioning as an input and the p-channe l pullup transistor is controlled by its respective po bits. if the po bit is set to 1, the weak pullup is on; if the po bit is cleared to 0, the weak pullup is off and forces the port pin into three-state. pd1 (09h, 01h) port 1 direction register initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. pd1.[6:0]: port 1 direction register bits 6:0. pd1 is used to determine the direction of the port 1 function. the port pins are independently controlled by their directi on bit. when a bit is set to 1, its corresponding pin is used as an output; data in the po register is dri ven on the pin. when a bit is cleared to 0, its corresponding pin is used as an input, and allows an external signal to drive the pin. note that each port pin has a weak pullup circuit when functioning as an input and the p- channel pullup transistor is controlled by its respective po bits. if the po bit is set to 1, the weak pullup is on; if the po bit is cleared to 0, the weak pullup is off and forces the port pin into three- state. special note about p1.6: the rst input function remains enabled on p1.6 unless it is explicitly disabled (rstd = 1). this means that the ports control b its (pd, po) can be used to generate a reset (e.g., by driving the pin low). pd1.7: reserved reserved. reads return 0. eies0 (0ah, 01h) external interrupt edge select 0 register initialiation: eies0 is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. eies0.[7:0]: it[7:0] edge select for external interrupt bits 7:0 itx = 0: external interrupt x is positive-edge triggered. itx = 1: external interrupt x is negative-edge triggered. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 25 special function register bit descriptions (continued) eies1 (0bh, 01h) external interrupt edge select 1 register initialiation: eies1 is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. eies1.[3:0]: it[11:8] external interrupt edge select bits 11:8 itx = 0: external interrupt x is positive-edge triggered. itx = 1: external interrupt x is negative-edge triggered. eies1.[7:4]: reserved reserved. reads return 0. svm (0ch, 01h) supply voltage monitor register (16-bit register) initialiation: this register is set to 0700h on all forms of reset. read/write access: unrestricted read/write except svmrdy and svmth. the supply volt age monitor ready (svmrdy) bit is set and cleared by hardware only. svmth can only be wr itten to when the supply voltage monitor is disabled (svmen = 0). svm.0: svmen supply voltage monitor enable. setting this bit to 1 enables the monitoring of supply voltage according to svmth settings. clearing this bit to 0 disables the supp ly voltage monitoring circuitry. svm.1: svmrdy supply voltage monitor ready. this bit is set to 1 to indicate that the supply voltage monitor is ready for use. this bit is cleared to 0 when svmen = 0 or on entrance to stop mode if sv mstop = 0. svm.2: svmie supply voltage monitor interrupt enable. setting this bit to 1 generates an interrupt to the cpu when svmi is set to 1. clearing this bit to 0 disables the interrupt from g enerating. svm.3: svmi supply voltage monitor interrupt. this bit is set to 1 when the supply voltage falls below the set point defined by svth. clearing this bit to 0 clears the interrupt. however, i f the supply voltage is still below the set point, this flag is set again. setting this bit to 1 c auses an interrupt to the cpu when svmie = 1. svm.4: svmstop supply voltage monitor stop mode enable. setting this bit to 1 enables the supply voltage monitor circuit to operate during stop mode if svmen = 1. clearing this bit to 0 disa bles the supply voltage monitor when stop mode is enabled. svm.[7:5]: reserved reserved. reads return 0. svm.[11:8]: svth[3:0] supply voltage threshold bits [3:0]. these bits are used to select a user-defined supply voltage threshold under which an interrupt is generated to the cpu if enabled. the level can be adjusted from 2.0v to 3.5v in a 0.1v increment. the supply voltage monitor is ena bled by setting svmen = 1. the default value is 07h (2.7v). supply voltage monitor threshold = 2.0v + svmth[3:0] x 0.1v note that the svth bits can only be modified when svmen = 0. writing to thes e bits is ignored if svmen = 1. svm.[15:12]: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 26 ______________________________________________________________________________________ special function register bit descriptions (continued) fcntl (0dh, 01h) flash memory control register initialiation: this register is set to 80h on por and is unaffected by all other form s of reset. read/write access: unrestricted read, bits 2:0 are write accessible only by utility rom or logical data memory. (this register is not accessible by program code inside the flash memory because of the rule governing the pseudo-von neumann mapping. access is blocked by hardware.) a lso, write access to fcntl is prohibited when fbusy is 0. flash command bits 2:0. the below table shows the commands for flash operations provided by these bits. the mmu supports only these commands; other settings are res erved. using any reserved command results in no operation. fc[2:0] flash commands 000 read mode (default) 001 verify information block 010 write information block 011 write main memory block 100 erase information block 101 page erase of main memory block 110 mass erase of main memory block fcntl.[2:0]: fc[2:0] 111 load trim information fcntl.[6:3]: reserved reserved. reads return 0. fcntl.7: fbusy flash busy. this busy flag is cleared to a logic 0 to indicate the start of an erase/ program operation by the mmu immediately following the command sequence. it is hold low until the end of the operation. set/reset of this flag is synchronized with the sys tem clock. fdata (0eh, 01h) flash memory data register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read, write accessible only by utility rom or logi cal data memory. (this register is not accessible for program code inside the flash memory due to the rule g overning the pseudo-von neumann mapping.). also, write access to fcntl is prohibited wh en fbusy is 0. fdata.[15:0]: this register is used by the user software or the rom loader to suppor t the flash erase/program/verify operation. writing to this sfr has no effect on flas h operation until a valid flash command is first entered through the fc[2:0] bits of the fcntl sf r. all flash operation must be initiated by providing a valid command in the fcntl cont rol register followed by writing target address and data by the fdata sfr (when required by the command). pwcn (0fh, 01h) power control register (16-bit register) initialiation: implemented register bits (except for the eclko and endsp bit) are unaffect ed by resets other than power-on reset. the eclko and endsp bits are reset to 0 on any rese t. on power-on reset, this register is reset to 0000h (except that hfxd is 1 for pck = 11b). read/write access: unrestricted read. flock is read-only. pwcn.0: fllen fll lock enable. setting this bit to 1 enables the fll if it is not already running, an d causes it to lock to the 32k input. when this bit is cleared to 0, the fll is disa bled if it is not providing the system clock. pwcn.1: flock fll lo cked. this is a read-only status bit. this bit is automatically r eset to 0 when fllen is changed from 0 to 1 and set to 1 when the fll is locked to the 32.768khz cl ock. this bit is also reset to 0 on entry to stop mode. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 27 special function register bit descriptions (continued) pwcn.2: eclko enable clock output pin. setting this bit to 1 enables the output of the dspcore undivi ded system clock on p2.2. the p2.2 pin also serves as the spi serial clock ( sclk) special function. the spi hardware should not be used when the clko output is enabled. the eclko bi t can be used in the hybrid configuration to allow the test system clock to be routed to the ds81 02 clkio pin. pwcn.[4:3]: reserved reserved. reads return 0. pwcn.5: rstd reset pin disable. when set to a logic 1, the reset input function is disconnected from the external rst pin. the port pin can then be used for other purposes. when cleared to a logic 0, the reset input function is connected to the external pin; however, the port dir ectional and output controls still apply. this bit defaults to 0 on power-on reset only. pwcn.6: regen regulator enable. when set to 1, the internal regulator remains powered on when the de vice is placed in stop mode. when cleared to 0, the internal regulator i s shut down to conserve power. the regulator is always enabled outside of stop mode, independent of the regen b it setting. pwcn.7: bod brownout-detection disable. this bit determines whether the brownout detection is enabled in stop mode when the regulator is off (regen = 0). when the regulator is enable d (as in normal operation or when regen = 1 in stop mode), the brownout detection is always enabled, in dependent of the bod bit setting. otherwise, when set to 1, the brownout reset detectio n for v dd is disabled when the device is placed into stop mode. when placed into stop mode w ith bod = 1 and regen = 0, the brownout reset comparator is shut down. when configured to 0 with regen = 0, the brownout- detection function is enabled for detecting the condition v dd < v rst during stop mode. pwcn.[9:8]: reserved reserved. reads return 0. pwcn.10: endsp enable dspcore. this active-high bit is cleared to 0 on any usercore reset and whe n the usercore invokes stop mode. when cleared, the dspcore is completely disabled. this bit is read/write accessible only to the usercore so that it controls when the s lave dspcore is allowed to operate. when this bit is written to 1, the dspcore is removed from r eset and is allowed to operate. pwcn.[15:11]: reserved reserved. reads return 0. bb0 (10h, 01h) battery-backed register 0 (16-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: unrestricted read/write access. bb0.[15:0]: battery-backed register 0 bits 15:0. this register is intended for quick and convenient storage of critical data through v dd power outages (avoiding the more time-consuming write attempts to external serial nv memory). bb1 (11h, 01h) bb2 (12h, 01h) bb3 (13h, 01h) bb4 (14h, 01h) bb5 (15h, 01h) bb6 (16h, 01h) bb7 (17h, 01h) see the bb0 register for description. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 28 ______________________________________________________________________________________ special function register bit descriptions (continued) rtrm (18h, 01h) real-time clock trim register (8-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: unrestricted read, write access only when the we = 1 and busy = 0. a n attempted write operation is not complete until hardware clears the busy bit. rtrm.[6:0]: trm[6:0] rtc trim calibration register bits 6:0. these register bits provide a binary value between 00hC 7fh, which is used for adjusting 32k clocks insertion/removal. at ev ery 10-second interval, the number of 32k clocks equal to the rtrm[6:0] numeric value is ins erted/removed from the rtc counter depending on the value in the tsgn bit. the trim bits are wr ite protected by we. we must be set to 1 for the bits to be updated. rtrm.7: tsgn rtc trim sign bit. this register bit selects whether 32k clocks are inserted (tsgn = 0) o r removed (tsgn = 1). rcnt (19h, 01h) real-time clock control register (16-bit register) initialiation: this register is initialized to 0sssss000000100sb on all form s of reset. bits 14C10 and bit 0 are battery backed through por so long as v bat(min) < v bat < v bat(max) . these battery-backed bits are indeterminate on the very first por and must be configured by the u ser, but are unaffected by other resets. read/write access: unrestricted read. bit 0 (rtce) is write accessible only when we = 1 and busy = 0. bits 3 (busy) and 13 (32krdy) are read-only. bit 4 can be cleared to 0 when rtce = 1; it can never be set to 1 by software. bit 15 is unrestricted write. all other bits are writ e accessible only when busy = 0. rcnt.0: rtce real-time clock enable. the rtce is the real-time enable bit. setting this bit to logic 1 activates the clocking by allowing the divided clock to the ripple counters. c learing this bit to logic 0 disables the clock. rcnt.1: ade alarm time-of-day enable. the ade bit is the rtcs time-of-day alarm enable and must be set to logic 1 for the alarm to generate a system interrupt reques t. when the ade is cleared to logic 0, the time-of-day alarm is disabled; no interrupt is generated even the al arm is set. rcnt.2: ase alarm subsecond enable. the ase bit is the rtcs subsecond timer enable and must be set t o logic 1 for the subsecond alarm to g enerate a system interrupt request. when the ase is cleared to logic 0, the subsecond alarm is disabled; no interrupt is genera ted even the alarm is set. rcnt.3: busy rtc busy. this bit is set to 1 by hardware when any of the following condi tions occur: 1) system reset. 2) software writes to rtc count registers or trim register. 3) software changes rtce, ase, or ade. for conditions 2) and 3), the write or change should not be considered complete un til hardware clears the busy bit. this is an indication that a 32khz synchronized version of the register bit(s) is in place. rcnt.4: rdy rtc ready. this bit is set to 1 by hardware when the rtc count registers update. it can be cleared to 0 by software at any time. it is also cleared to 0 by hardware just pr ior to an update of the rtc count register. this bit can generate an interrupt if the rdye bit is set to 1. rcnt.5: rdye rtc ready enable. setting this bit to 1 allows a system interrupt to be generated when rdy becomes active (if interrupts are enabled globally and modularly). c learing this bit to 0 disables the rdy interrupt. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 29 special function register bit descriptions (continued) rcnt.6: aldf alarm time-of-day flag. this bit is set when the contents of rtsh and rtsl counter regis ters match the 20-bit value in the rash and rasl alarm registers. sett ing the aldf causes an interrupt request to the cpu if the ade is set and interrupt is allowed at the system level. this flag must be cleared by software once set. this alarm is qualified as a wake up to the stop and the switchback function if its interrupt has not been masked. rcnt.7: alsf alarm subsecond flag. this bit is set when the subsecond timer has been reloaded by the rssa register. setting the alsf causes an interrupt request to the cpu if the ase is set and the interrupt is allowed at the system level. this flag must be cleared by softwar e once set. this alarm is qualified as a wake up to the stop and the switchback function if its interrupt have not been ma sked. rcnt.8: sqe rtc square-wave output enable. setting this bit to a logic 1 enables either the 1hz tap or the 512hz tap of the rtc to the sqw pin. when cleared to 0, the sqw pin is not driven by the rtc. because the p1.3 pin has two possible special function outputs, the sqw spec ial function takes priority over the jtag tdo special function output if both are enabl ed. rcnt.9: ft rtc frequency test. this register bit selects the frequency output that is possible on th e sqw pin if the square-wave output is enabled. setting ft = 1 selects the 512hz output ( when sqe = 1) while ft = 0 selects the 1hz output (when sqe = 1). this bit has no function if the s quare-wave output is disabled. 32k oscillator mode bits [1:0]. these two bits determine the 32k oscillator operation modes as shown in the below table. changing the value of these bits when the 32k input is enabled (x32d = 0) resets the 32krdy bit to 0 if the new setting requires the oscillator circuitry to warm up. 32kmd[1:0] 32k oscillator mode 00 always operate in noise immune mode. 01 always operate in quiet mode. 10 operate in noise immune mode normally, switch to quiet mode on stop mode entry. on stop mode exit, the cpu code execution must wait for 32k oscillator to transition (warm up) from quiet mode to noise im mune mode. rcnt.[11:10]: 32kmd[1:0] 11 operate in noise immune mode normally, switch to quiet mode on stop mode entry. on stop mode exit, the cpu code execution can occur during the 32k oscillator transition (warm up) from quiet mode to noise immune mode. rcnt.12: 32kbyp 32k bypass enable. setting this bit to 1 disables the internal oscillator circu itry connected between the internal cx1 and cx2 pins. in this configuration, any peripheral that is using the 32k input can be driven externally by a clock signal provided on the cx1 pin. clearing this bit to 0 enables the internal crystal oscillator circuitry. when th e internal oscillator circuitry is enabled, 250ms are required before the crystal oscillator has warmed u p. this bit can only be changed when rtce = 0. note that this bit has no effect when x32d is set to 1. rcnt.13: 32krdy 32k input ready. this bit is set to 1 by hardware after the 32k oscillator has warmed up and is ready to source as input to system clock or peripherals. this bit i s cleared to 0 when x32d is set to 1 or when x32d = 0 and 32kmd values have changed to require the 32k circuitry to warm up. user application should check that the 32k input is ready (32krdy = 1) befo re enabling any peripherals that use the 32k input as time base; otherwise timing ac curacy is compromised. this bit is read-only. rcnt.14: x32d 32k external input disable. setting this bit to 1 disables the 32k circuitry. no external 32k clock source is accepted. clearing this bit to 0 enables the 32k circuitry. th e source of the input is configured through the 32kbyp bit. this bit can only be changed when rtce = 0. note: if x32d = 0 in stop mode, the 32k source is still available in stop mode . rcnt.15: we rtc write enable. this register bit serves as a protection mechanism against undesirab le writes to the rtce bit and rtrm register. this bit must be set to a 1 to give wri te access to the rtrm register and the rtce bit; otherwise (when the we bit = 0) these protected bi ts are read-only. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 30 ______________________________________________________________________________________ special function register bit descriptions (continued) rtss (1ah, 01h) rtc subsecond counter register (8-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: write accessible when rtce = 0 and busy = 0. read accessible at all times , but the value could be indeterminate if rdy = 0. software should be careful to read this register only when rdy = 1. rtss.[7:0]: rtc subsecond counter bit 7:0. this ripple counter represents 1/256-second resolution for the rtc and its content is incremented with each 256hz clock tick derived fr om the 32.768khz oscillator. w hen the counter rollover, its output is used to drive the 32-bit second counter. rtsh (1bh, 01h) rtc second counter high register (16-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: write accessible when rtce = 0 and busy = 0. read accessible at all times , but the value could be indeterminate if rdy = 0. software should be careful to read this register only when rdy = 1. rtsh.[15:0]: rtc second counter high bit 15:0. this register contains the most significant bits for the 32-bit second counter. the rtc is a ripple counter that consists of cascading t he 32-bit second counter and 8-bit subsecond counter (rtsh, rtsl, and rtss). rtsl (1ch, 01h) rtc second counter low register (16-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: write accessible when rtce = 0 and busy = 0. read accessible at all times , but the value could be indeterminate if rdy = 0. software should be careful to read this register only when rdy = 1. rtsl.[15:0]: rtc second counter low bit 15:0. this register contains the least significant bits for the 32-bit second counter. the rtc is a ripple counter that consists of cascading t he 32-bit second counter and 8-bit subsecond counter (rtsh, rtsl, and rtss). rssa (1dh, 01h) rtc subsecond alarm register (8-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: unrestricted read. write accessible when busy = 0 and either (ase = 0 or rtce = 0). rssa.[7:0]: rtc subsecond alarm register bit 7:0. this register contains the reload value for the subsecond alarm. the alsf bit is set when an autoreload occurs. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 31 special function register bit descriptions (continued) rash (1eh, 01h) rtc alarm time-of-day high register (8-bit register) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: bits 3:0 are write accessible when either (ade = 0 or rtce = 0). bits 3:0 are read ac cessible at all times. bits 7:4 are not write accessible and always read 0. rash.[3:0]: rtc time-of-day high bit 3:0. this register contains the most significant bits for the 20-bit ti me-of- day alarm. the time-of-day alarm is formed by the rash and the rasl registers and only the lower 20 bits is meaningful for the alarm function. the time-of-day alarm is t riggered when 1) the subsecond counter rolls over and 2) the 20 significant bits of the rash:rasl register pair match the 20 least significant bits of the rtc (the rtsh:rtsl register pair) . rash.[7:4]: reserved reserved. reads return 0. rasl (1fh, 01h) rtc alarm time-of-day low register (16-bit register ) initialiation: this register is battery backed through por so long as v bat(min) < v bat < v bat(max) ; however, it is indeterminate on the very first por and must be configured i nitially by the user. this register is unaffected by other resets. read/write access: unrestricted read. write accessible when busy = 0 and either (ade = 0 or r tce = 0). rasl.[15:0]: rtc time-of-day low bit 15:0. this register contains the least significant bits for the 20-bit ti me-of- day alarm. the time-of-day alarm is formed by the rash and the rasl registers and only the lower 20 bits are meaningful for the alarm function. the time-of-day alarm is triggered when 1) the subsecond counter rolls over and 2) the 20 significant bits of the rash:rasl register pair match the 20 least significant bits of the rtc (the rtsh:rtsl register pair) . t2cna (00h, 02h) timer 2 control register a initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. t2cna.0: g2en gating enable. this bit enables the external t2p pin to gate the input clock to the 16-b it (t2md = 0) or highest 8-bit (t2md = 1) timer. gating uses t2p as an input, thus i t can only be used when t2oe0 = 0 and c/ t2 = 0. gating is not possible on the low 8-bit timer (t2l) when tim er 2 is operated in dual 8-bit mode. gating does not make sense when counter operation is selected as the t2 input is being counted. the g2en bit serves a different p urpose when capture and reload have been defined for both edges (ccf[1:0] = 11b and cprl2 = 1). for t his special case, setting g2en = 1 allows the t2pol0 bit to specify which edge does not cause a reload. if t2pol0 is 0, there is no reload on the falling edge; if t2pol0 is 1, there is no reload on the ris ing edge. 0 = gating disabled 1 = gating enabled downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 32 ______________________________________________________________________________________ special function register bit descriptions (continued) t2cna.1: ss2 single shot. this bit is used to automatically override or delay the effect of the tr 2 bit setting. the single-shot bit is only useful in the timer mode of operation (c/ t2 = 0) and should not be set to 1 when the counter mode of operation is enabled (c/ t2 = 1). compare mode: if ss2 is written to a 1 while in compare mode, one cycle of the defined wa veform (reload to overflow) is output to the t2p, t2pb pins as prescribed b y t2pol[1:0] and t2oe[1:0] controls. the only time that this does not immediately occur is when a gating condition is also defined. if a gating condition is defined, the single-shot cycle cannot occu r until the gating condition is removed. if the specified nongated level is already i n effect, the single-shot period starts. the gated single-shot output is not supported in dual 8- bit mode. capture mode: if ss2 is written to a 1 while in capture mode, the timer is halted and the single-shot capture cycle does not begin until 1) the edge specified by ccf[1:0] is detected or 2) the defined gating condition is removed. once running, the timer continues runn ing (as allowed by the gate condition) until the defined capture single-shot edge is detected. in this way, the ss2 bit can be used to delay the running of a timer until an edge is detected (setti ng both ss2 and tr2 = 1) or override the tr2 = 0 bit setting for one capture cycle (setting only ss2 = 1). when both edges are defined for capture ccf[1:0] = 11b, the t2pol0 bit serves to define the single-sh ot start/end edge: falling edge if t2pol0 = 1; rising edge if t2pol0 = 0. no interr upt flag is set when the starting edge for the single-shot capture cycle is detected. the singl e-shot capture cycle always ends when the next single-shot edge is detected. the start/end edge is de fined by t2pol0. this bit is intended to automate pulse-width measurement (low or high) and duty cycl e/period measurement. t2cna.2: cprl2 capture and reload enable. this bit enables a reload (in addition to a capture) on the edge specified by ccf[1:0] when operating in capture/reload mode (c/ t2 = 0). if both edges are defined for capture/reload (ccf[1:0] = 11b), enabling the gating control (g2en = 1) allo ws the t2pol0 bit to be used to prevent a reload on one of the edges. if t2pol 0 is 0, no reload on the falling edge; if t2pol0 is 1, no reload on the rising edge. 0: capture on edge(s) specified by ccf[1:0] bits 1: capture and reload on edge(s) specified by ccf[1:0] bits t2cna.3: tr2 timer 2 run enable. this bit starts/stop timer 2. in the dual 8-bit mode of operation, this bi t applies only to the t2h timer/counter. otherwise, the bit applies to the full 16-bit t2h:t2l timer/counter. when the timer is stopped (tr2 = 0), the timer registers hold their c ount. the single-shot bit (ss2) can override and/or delay the effect of the tr2 bit. 0: timer 2 stopped 1: timer 2 run t2cna.4: tr2l timer 2 low run enable. this bit starts/stops the low 8-bit timer (t2l) when dual 8-bit mod e (t2md = 1) is in effect. this bit has no effect when t2md = 0. 0: timer 2 low stopped 1: timer 2 low run t2cna.5: t2pol0 timer 2 polarity select 0. when the timer 2 output function has been enabled (t2oe0 = 1), the polarity select bit defines the starting logic level for the t2p o utput waveform. when t2pol0 = 0, the starting state for the t2p output is logic-low. when t2pol0 = 1, the starti ng state for the t2p output is logic-high. the t2pol0 bit can be modified any time, but takes effect on the external pin when t2oe0 is changed from 0 to 1. when the timer 2 pin is being used a s an input (t2oe0 = 0), the polarity select bit defines which logic level can be used to gate the timer input clock (when ccf[1:0] <> 11b). when ccf[1:0] = 11b, t2pol0 defines which edge can start/stop a single-shot capture and which edge reload can be skipped (if cprl2 = 1 and g2en = 1) . downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 33 special function register bit descriptions (continued) timer 2 output enable 0. this register bit enables the timer 2 output function for the external t2 p pin. the table below shows timer 2 output possibilities for the t2p, t2pb pins. t20e[1:0] t2md t2p pin t2pb pin 00 x port latch data port latch data 01 0 16-bit pwm output port latch data 10 0 port latch data 16-bit pwm output 11 0 16-bit pwm output 16-bit pwm output 01 1 8-bit pwm output (t2h) port latch data 10 1 port latch data 8-bit pwm output (t2l) t2cna.6: t2oe0 11 1 8-bit pwm output (t2h) 8-bit pwm output (t2l) t2cna.7: et2 enable timer 2 interrupts. this bit serves as the local enable for timer 2 interrupt sources that fa ll under the tf2 and tcc2 interrupt flags. t2h (01h, 02h) timer 2 most significant byte initialiation: the timer 2 most significant byte is cleared to 00h on all forms of re set. read/write access: unrestricted read/write. t2h.[7:0]: timer 2 msb bits 7:0. this register is used to load and read the most significant 8-bit value in ti mer 2. t2rh (02h, 02h) timer 2 most significant byte reload initialiation: the timer 2 most significant byte is cleared to 00h on all forms of r eset. read/write access: unrestricted read/write. t2rh.[7:0]: timer 2 reload msb bits 7:0. this register is used to load and read the most significant 8-bit value in timer 2. t2ch (03h, 02h) timer 2 most significant byte capture/compare initialiation: this byte is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. t2ch.[7:0]: timer 2 capture/compare msb bits 7:0. this register reflects the upper byte of the timer 2 capture/compare value and is read/write accessible at all times. po2 (04h, 02h) port 2 output register (8-bit register) initialiation: this register is set to 1fh on all forms of reset. read/write access: unrestricted read/write. po2.[6:0]: port 2 output register bits 6:0. the po2 register stores output data for port 2 when it is defined as an output port and controls whether the internal weak p-channel pull up transistor is enabled/disabled if a port pin is defined as an input. the contents of this register can be modified by a write access. reading from the register returns the contents of th e register. changing the direction of port 2 does not change the data contents of the register. po2.7: reserved reserved. reads return 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 34 ______________________________________________________________________________________ special function register bit descriptions (continued) pi2 (05h, 02h) port 2 input register initialiation: the reset value for this register is dependent on the logical states of the pins. read/write access: unrestricted read-only. pi2.[6:0]: port 2 input register bits 6:0. the pi2 register always reflects the logic state of its pins when read. note that each port pin has a weak pullup circuit when functioning as an input and the p-channel pullup transistor is controlled by its respective po bits. i f the po bit is set to 1, the weak pullup is on; if the po bit is cleared to 0, the weak pullup is off and forces the port pin into three-state. pi2.7: reserved reserved. reads return 0. scon0 (06h, 02h) serial port 0 control register initialiation: the serial port control is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. scon0.0: ri receive interrupt flag. this bit indicates that a data byte has been received in the serial port buffer. the bit is set at the end of the 8th bit for mode 0, after the last sample of the incoming stop bit for mode 1 subject to the value of the sm2 bit, or after the last sample of rb8 for modes 2 and 3. this bit must be cleared by software once set. scon0.1: ti transmit interrupt flag. this bit indicates that the data in the serial-port data buffer has b een completely shifted out. it is set at the end of the last data bit for al l modes of operation and must be cleared by software once set. scon0.2: rb8 9th received bit state. this bit identifies the state of the 9th bit of received data in seri al port modes 2 and 3. when sm2 is 0, it is the state of the stop bit in mode 1. this bit has no meaning in mode 0. scon0.3: tb8 9th transmission bit state. this bit defines the state of the 9th transmission bit in serial port modes 2 and 3. scon0.4: ren receive enable ren_0 = 0: serial port 0 receiver disabled. ren_0 = 1: serial port 0 receiver enabled for modes 1, 2 and 3. initiate synchronous reception for mode 0. scon0.5: sm2 serial port 0 mode bit 2. setting this bit in mode 1 ignores reception if an invalid st op bit is detected. setting this bit in mode 2 or 3 enables multiprocessor communicati ons, and prevents the ri bit from being set and the interrupt from being asserted if the 9th bit receiv ed is 0. this bit is also used to support mode 0 for clock selection. sm2 = 0: clock is divided by 12 sm2 = 1: clock is divided by 4 scon0.6: sm1 serial port 0 mode bit 1 downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 35 special function register bit descriptions (continued) serial port 0 mode bit 0/framing error flag. when fede is 0, this is the sm0 bit. when fede is set to 1, this bit is the fe that is set upon detection of an invalid stop bit. it must be cleared by software. modification of this bit when fede is set has no effect on the serial mode. mode sm2 sm1 sm0 function length (bits) period 0 0 0 0 synchronous 8 12 system clock 0 1 0 0 synchronous 8 4 system clock 1 x 1 0 asynchronous 10 64/16 baud clock (smod = 0/1) 2 0 0 1 asynchronous 11 64/32 system clock (smod = 0/1) 2 1 0 1 asynchronous (mp) 11 64/32 system clock (smod = 0/1) 3 0 1 1 asynchronous 11 64/16 baud clock (smod = 0/1) scon0.7: sm0/fe 3 1 1 1 asynchronous (mp) 11 64/16 baud clock (smod = 0/1) sbuf0 (07h, 02h) serial data buffer 0 initialiation: this buffer is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. sbuf0.[7:0]: serial data buffer 0 bit 7:0. data for serial port 0 is read from or written to this location. the s erial transmit and receive buffers are separate, but both are addressed at this l ocation. smd0 (08h, 02h) serial port mode register 0 initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. smd0.0: fede framing-error-detection enable. this bit selects the function of sm0 (scon0.7). fede = 0: scon0.7 functions as sm0 for serial-port mode selection. fede = 1: scon0.7 is converted to the fe flag. smd0.1: smod serial port 0 baud-rate select. the smod selects the final baud rate for the asynchronous mode: smod = 1: 16 times the baud clock for mode 1 and 3; 32 times the system clock for mode 2. smod = 0: 64 times the baud clock for mode 1 and 3; 64 times the system clock for mode 2. smd0.2: esi enable serial port 0 interrupt. setting this bit to 1 enables interrupt requests generated by t he ri or ti flags in scon0. clearing this bit to 0 disables the serial port interrupt. smd0.[5:3]: reserved reserved. reads return 0. smd0.6: ofs output function select. this bit selects the pwm output function when epwm = 1. when epwm = 1, the ofs bit selects one of the following modes: ofs = 0: logical nor between uart0 txd output and t2l waveform. ofs = 1: logical or between uart0 txd output and t2l waveform. note that the pwm function is not possible for uart mode 0 and this bit has no ef fect during uart mode 0 operation. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 36 ______________________________________________________________________________________ special function register bit descriptions (continued) smd0.7: epwm enable txd pwm output function. setting this bit to a 1 enables the output of the logical function selected by the ofs bit to be output on the txd0 pin for the asynchronou s uart transmit modes (i.e., modes 1, 2, and 3). note that the pwm function is not possible fo r uart mode 0 and this bit has no effect during uart mode 0 operation. when this bit is cleared to 0, the ofs bit is meaningless and the normal txd0 pin controls and behavior apply. pr0 (09h, 02h) phase register 0 initialiation: the phase register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. pr0.[15:0]: phase register 0 15:0. this register is used to load and read the 16-bit value in the phase regis ter that determines the baud rate for the serial port 0. pd2 (0ah, 02h) port 2 direction register initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. pd2.[6:0]: port 2 direction register bits 6:0. pd2 is used to determine the direction of the port 2 function. the port pins are independently controlled by their direction bit. when a bi t is set to 1, its corresponding pin is used as an output; data in the po register is driven on the pin. when a bi t is cleared to 0, its corresponding pin is used as an input, and allows an external signal to d rive the pin. note that each port pin has a weak pullup circuit when functioning as an input and the p-channe l pullup transistor is controlled by its respective po bits. if the po bit is set to 1, the weak pullup is on; if the po bit is cleared to 0, the weak pullup is off and forces the port pin into three-state. pd2.7: reserved reserved. reads return 0. t2cnb (0bh, 02h) timer 2 control register b initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. t2cnb.0: t2cl timer 2 low compare flag. this flag is meaningful only for the dual 8-bit mode of operation (t2md = 1) and becomes set only when a compare match occurs between t2cl and t2l. ti mer 2 low does not have an associated capture function. t2cnb.1: tcc2 timer 2 capture/compare flag. this flag is set on any compare match between the timer 2 value and compare register (t2v = t2c or t2h = t2ch, respectively, for 16-bit an d 8-bit compare modes) or when a capture event is initiated by an external edge. t2cnb.2: tf2l timer 2 low overflow flag. this flag is meaningful only when in the dual 8-bit mode of operation (t2md = 1) and becomes set whenever there is an overflow of the t2l 8-bit ti mer. t2cnb.3: tf2 timer 2 overflow flag. this flag becomes set anytime there is an overflow of the full 16-bit t2 timer/counter (when t2md = 0) or an overflow of the 8-bit t2h timer/cou nter when the dual 8-bit mode of operation is selected (t2md = 1). t2cnb.4: reserved reserved. reads return 0. t2cnb.5: t2pol1 timer 2 polarity select 1. when the t2b output is enabled (t2oe1 = 1), this bit selects the starti ng logic level for the alternate pin output. the output that is driven on the t2 pb pin can be derived from the 16-bit timer 2 or the 8-bit timer (t2l) depending upon whether operating in the 16-bit mode or the dual 8-bit mode. the t2pol1 bit can be modified any time, but takes effe ct on the external pin when t2oe1 is changed from 0 to 1. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 37 special function register bit descriptions (continued) t2cnb.6: t2oe1 timer 2 output enable 1. see the table given under t2cna.6 bit description. the t2oe1 bit is not implemented for single pin versions of timer 2. t2cnb.7: et2l enable timer 2 low interrupts. this bit serves as the local enable for timer 2 low interrupt s ources that fall under the tf2l and t2cl interrupt flags. t2v (0ch, 02h) timer 2 value register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. t2v.[15:0]: timer 2 value register bits 15:0. the t2v register is a 16-bit register that holds the current timer 2 value. when operating in 16-bit mode (t2md = 0), the full 16 bits ar e read/write accessible. if the dual 8-bit mode of operation is selected, the upper byte of t2v i s inaccessible. t2v reads while in the dual 8-bit mode return 00h as the high byte and writes to the upper byte of t2v are blocked. a separate t2h register is provided to facilitate high-byte access. t2r (0dh, 02h) timer 2 reload register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. t2r.[15:0]: timer 2 reload register bits 15:0. this 6-bit register holds the reload value for timer 2. when operating in 16-bit mode (t2md = 0), the full 16 bits are read/write acc essible. if the dual 8-bit mode of operation is selected, the upper byte of t2r is inaccessi ble. t2r reads while in the dual 8-bit mode return 00h as the high byte and writes to the upper byte of t2r are blocked. a separate t2rh register is provided to facilitate high-byte access. t2c (0eh, 02h) timer 2 capture/compare register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. t2c.[15:0]: timer 2 capture/compare register bits 15:0. this 16-bit register that holds the compare value when operating in compare mode and gets the capture value when operating in capture mode. when operating in 16-bit mode (t2md = 0), the full 16 bits are read/write accessible. if the dual 8- bit mode of operation is selected, the upper byte of t2c is inaccessi ble. t2c reads while in the dual 8-bit mode return 00h as the high byte and writes to the upper b yte of t2c are blocked. a separate t2ch register is provided to facilitate high-byte access . t2cfg (0fh, 02h) timer 2 configuration register initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. t2cfg.0: c/ t2 timer 2 counter/timer select. this bit enables/disables the edge counter mode of operation for the 16-bit counter (t2h:t2l) or the 8-bit counter (t2h) when the dual 8-bit mode of operation is enabled (t2md = 1). the edge for counting (rising/falling/b oth) is defined by the ccf[1:0] bits. 0: timer mode 1: counter mode downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 38 ______________________________________________________________________________________ special function register bit descriptions (continued) timer 2 capture/compare function select. these bits, in conjunction with the c/ t2 bit, select the basic operating mode of timer 2. in the dual 8-bit mode of operati on (t2md = 1), the secondary timer (t2l) always operates in compare mode. ccf[1:0] edge(s) c/ t2 = 0 (timer mode) c/ t2 = 1 (counter mode) 00 none compare mode disabled 01 rising capture/reload counter 10 falling capture/reload counter t2cfg.[2:1]: ccf[1:0] 11 rising and falling capture/reload counter t2cfg.3: t2md timer 2 mode select. this bit enables the dual 8-bit mode of operation. the default rese t state is 0, which selects the 16-bit mode of operation. when the dual 8-bit mo de is established, the primary timer/counter (t2h) carries all the counter/capture functionality with it while the secondary 8- bit timer (t2l) must operate in timer compare mode, sourcing the defined int ernal clock. 0: 16-bit mode (default) 1: dual 8-bit mode timer 2 clock divide 2:0 bits. these three bits select the divide ratio for the timer clock when operating in timer mode. t2div[2:0] divide ratio 000 1 001 2 010 4 011 8 100 16 101 32 110 64 t2cfg.[6:4]: t2div[2:0] 111 128 t2cfg.7: t2ci timer 2 clock input select bit. setting this bit enables an alternate input clock source to the time r 2 block. the alternate input clock selection is the 32khz clock. the alterna te input clock must be sampled by the system clock, which requires that the system clock be at le ast 4 x 32khz for proper operation. mcnt (00h, 03h) multiplier control register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read, write is allowed for all bits except bit 7 and 15. bit 7 and 15 are read-only. mcnt.0: sus signed-unsigned. this bit determines the data type of the operands. when this bit is cleared to 0, the multiplier performs a signed operation; the operands are twos comp lement values. when this bit is set to logic 1, the multiplier performs an unsigned oper ation with the operands as absolute magnitudes. mcnt.1: mmac multiply-accumulate enable downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 39 special function register bit descriptions (continued) multiply-accumulate negate. the state of the msub and mmac bits determines the operation of the hardware multiplier. the accumulator mc is formed by the mc2, mc1, and mc0 registers. msub mmac operation 0 0 ma x mb 0 1 mc + (ma x mb) 1 0 - (ma x mc) mcnt.2: msub 1 1 mc - (ma x mb) mcnt.3: opcs operand count select. this bit is used to select a number of operands for the multiplication operation. when this bit is cleared to logic 0, an operation is i nitiated after two operands are written to the ma and mb registers. when this bit is set to logic 1, an oper ation is initiated after an operand is written to either the ma or the mb register. this bit has no m eaning if the squ bit is set. this bit has no effect on division. mcnt.4: squ square-function enable. this bit is used to support hardware square function. when this b it is set to logic 1, a square operation is initiated after an operand is written to eith er the ma or the mb register. writing data to either of the operand registers writes to both regi sters and triggers a square calculation. setting this bit to 1 also disables the opcs function. when this bit is cleared to logic 0, the hardware square function is disabled. this bit has no effect on di vision. mcnt.5: cld clear data register. this bit is used to initialize the operand registers and the accum ulator of the multiplier. the contents of all five data registers and the of bit are c leared to 0 and the sequence counter is reset immediately after the cld is set. this bit is cleared by hardware automatically. if an operation is in progress (divsz = 1) when this bit is set to 1, the operation is aborted and the contents of all data registers and the of bit are cleared to 0. writing this bit to 0 causes no operation. mcnt.6: mcw mc register write select. the state of the mcw bit determines if a multiplication operation result is placed into the accumulator register (mc): if mcw is 0, the result is written to the mc register. if mcw is 1, the result is not placed into the mc register and the con tent of the mc register is not changed. this bit has no effect on division. mcnt.7: of overflow flag. this bit is set to logic 1 when an overflow occurred for the last operat ion. this bit is automatically cleared to 0 following a reset, starting a multiplier/di vision operation or the setting of the cld bit to 1. mcnt.8: reserved reserved. do not write a 1 to this location. functionally, this is the dive bit, however, there ar e problems with the divide operation. mcnt.[15:9]: reserved reserved. reads return 0. ma (01h, 03h) multiplier operand a register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. ma.[15:0]: multiplier operand a bit 15:0. this operand a register is used by the user software to load a 16-bit value for a multiplier operation. loading of the ma and mb registers ini tiates a selected multiplier operation, dependent on the setting of the mmac bit. the data type is dete rmined by the sus bit. the result is stored to the mc register. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 40 ______________________________________________________________________________________ special function register bit descriptions (continued) mb (02h, 03h) multiplier operand b register initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. mb.[15:0]: multiplier operand b bit 15:0. this operand b register is used by the user software to load a 16-bit value for a multiplier operation. loading of the ma and mb registers ini tiates a selected multiplier operation, dependent on the setting of the mmac bit. the data type is dete rmined by the sus bit. the result is stored to the mc register. mc2 (03h, 03h) multiplier accumulate register 2 initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. mc2.[15:0]: multiplier accumulate register 2 bit 15:0. the mc2 register represents the two most significant bytes of the accumulator register. the 48-bit accumulator is formed by m c2, mc1, and mc0. this register is used in multiply-accumulate operation. for a signed ope ration, the most significant bit of this register is the signed bit. mc1 (04h, 03h) multiplier accumulate register 1 initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. mc1.[15:0]: multiplier accumulate register 1 bit 15:0. the mc1 register represents bytes 3 and 2 of the accumulator register. the 48-bit accumulator is formed by mc2, mc1, an d mc0. mc0 (05h, 03h) multiplier accumulate register 0 initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. mc0.[15:0]: multiplier accumulate register 0 bit 15:0. the mc0 register represents the two least significant bytes of the accumulator register. the 48-bit accumulator is formed by m c2, mc1, and mc0. spib (07h, 03h) spi data buffer (16-bit register) initialiation: this buffer is cleared to 0000h on all forms of reset. read/write access: unrestricted read, write is allowed outside of a transfer cycle; w hen the stby bit is set, write is blocked and causes write collision error. spib.[15:0]: spi data buffer bits 15:0. data for spi is read from or written to this location. the serial transmi t and receive buffers are separate but both are addressed at this location. mc1r (08h, 03h) multiplier read register 1 initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read-only. mc1r.[15:0]: multiplier read register 1 bit 15:0. during multiplication, the mc1r register represents bytes 3 and 2 result from the last operation when mcw bit is 1 or the last operation i s either multiply-only or multiply-negate. when mcw bit is 0 and the last operation is either multi ply-accumulate or multiply-subtract, the contents of this register may or may not agree wi th the contents of mc1 due to the combinatorial nature of the adder. the contents of this register rema in until a sfr content related to the multiplier has been changed. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 41 special function register bit descriptions (continued) mc0r (09h, 03h) multiplier read register 0 initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read-only. mc0r.[15:0]: multiplier read register 0 bit 15:0. during multiplication, the mc0r register represents bytes 1 and 0 result from the last operation when mcw bit is 1 or the last operation i s either multiply-only or multiply-negate. when mcw bit is 0 and the last operation is either multi ply-accumulate or multiply-subtract, the contents of this register may or may not agree wi th the contents of mc0 due to the combinatorial nature of the adder. the contents of this register rema in until a sfr content related to the multiplier has been changed. spicn (0dh, 03h) spi control register initialiation: this buffer is cleared to 00h on all forms of reset. read/write access: unrestricted read/write, except bit 7 is read-only. spicn.0: spien spi enable. setting this bit to 1 enables the spi module and its baud-rate generator for spi operation. clearing this bit to 0 disables the spi module and its baud-rate g enerator. spicn.1: mstm master mode enable. mstm functions as a master-mode enable bit for the spi module. when mstm is set to 1, the spi operates as a master. when mstm is cleared to 0, th e spi module operates in slave mode. note that this bit can be set from 0 to 1 only wh en the ssel signal is deasserted. spicn.2: modfe mode fault enable. when set to a logic 1 in master mode, this bit enables the use of ssel input as a mode fault signal; when cleared to 0, the ssel has no function and its port pin can be used for other purposes. in slave mode, the ssel pin always functions as a slave-select input signal to the spi module, independent of the setting of the modfe bit. spicn.3: modf mode fault flag. this bit is the mode fault flag when the spi is operating as a mast er. when mode- fault detection is enabled as modfe = 1 in master mode, a detection of a hig h-to-low transition on the ssel pin signifies a mode fault and sets the modf to 1. this bit must be cl eared to 0 by software once set. setting this bit to 1 by software causes an interr upt if enabled. this flag has no meaning in slave mode. spicn.4: wcol write collision flag. this bit indicates a write collision when set to 1. this is cau sed by attempting to write to the spib while a transfer cycle is in progress. th is bit must be cleared to 0 by software once set. setting this bit to 1 by software causes an interr upt if enabled. spicn.5: rovr receive overrun flag. this bit indicates a receive overrun when set to 1. this is caused by two or more characters that have been received since the last read by the proce ssor. the newer data is lost. this bit must be cleared to 0 by software once set. setting this bit to 1 by software causes an interrupt if enabled. spicn.6: spic spi transfer complete flag. this bit indicates the completion of a transfer cycle when set to 1. this bit must be cleared to 0 by software once set. setting this bit to 1 by s oftware causes an interrupt if enabled. spicn.7: stby spi transfer busy flag. this bit is used to indicate the current status of the spi module. stb y is set to 1 when starting an spi transfer cycle and is cleared to 0 when the tr ansfer cycle is completed. this bit is controlled by hardware and is read-only for user software. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 42 ______________________________________________________________________________________ special function register bit descriptions (continued) spicf (0eh, 03h) spi configuration register initialiation: this buffer is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. spicf.0: ckpol clock polarity select. this bit is used with the ckpha bit to determine the spi transfer format. when the ckpol is set to 1, the spi uses the clock falling edge as an activ e edge. when the ckpol is cleared to 0, the spi selects the clock rising edge as an active edge. spicf.1: ckpha clock phase select. this bit is used with the ckpol bit to determine the spi transfer format. when the ckpha is set to 1, the spi samples input data at an inactive ed ge. w hen the ckpha is cleared to 0, the spi samples input data at an active edge. spicf.2: chr character length bit. the chr bit determines the character length for an spi transfer cycle. a character can consist of 8 or 16 bits in length. when chr bit i s 0, the character is 8 bits; when chr is set to 1, the character is 16 bits. spicf.[6:3]: reserved reserved. reads return 0. spicf.7: espii spi interrupt enable. setting this bit to 1 enables the spi interrupt when the modf, wcol, rov r, or spic flags are set. clearing this bit to 0 disables the spi interrup t. spick (0fh, 03h) spi clock register initialiation: this buffer is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. spick.[7:0]: clock divide ratio bit 7:0. these bits select one of the 256 divide ratios (0 to 255) used for the baud-rate generator, with bit 7 as the most significant bit. the frequency of the spi baud rate is calculated using the following equation: spi baud rate = 0.5 x system clock/(divide ratio + 1) this register has no function when operating in slave mode, and the cloc k generation circuitry should be disabled. i2cbuf (00h, 04h) i 2 c data buffer register (16-bit register) initialiation: this register is cleared to 0000h on all forms of resets. read/write access: unrestricted read access. this register can be written to only when i2cbusy = 0. i2cbuf.[9:0]: i 2 c data buffer bits 9:0. data for i 2 c transfer is read from or written to this location. the i 2 c transmit and receive buffers are separate but both are addressed at this location. during address transmission, i2cbuf.[6:0] is used as the address bits. during data tr ansmission, only i2cbuf.[7:0] is used. i2cbuf.[15:10]: reserved reserved. reads return 0. i2cst (01h, 04h) i 2 c status register (16-bit register) initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read. not all the bits can be written by software. for each b it accessibility, see the individual bit description. i2cst.0: i2csri i 2 c start interrupt flag. this bit is set to 1 when a start condition (s or sr) is detected. thi s bit must be cleared to 0 by software once set. setting this bit to 1 by softwar e causes an interrupt if enabled. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 43 special function register bit descriptions (continued) i2cst.1: i2ctxi i 2 c transmit complete interrupt flag. this bit indicates that an address or a data byte has been successfully shifted out and the i 2 c controller has received an acknowledgment from the receiver (nack or ack). this bit must be cleared by software once set. setting thi s bit to 1 by software causes an interrupt if enabled. i2cst.2: i2crxi i 2 c receive ready interrupt flag. this bit indicates that a data byte has been received in the i 2 c buffer. this bit must be cleared by software once set. setting this b it to 1 by hardware causes an interrupt if enabled. this bit is set by hardware only. i2cst.3: i2cstri i 2 c clock stretch interrupt flag. this bit indicates that the i 2 c controller is operating with clock stretching enabled and is holding the scl clock signal low. the i 2 c controller releases scl after this bit has been cleared to 0. setting this bit to 1 by hardware cause s an interrupt if enabled. this bit must be cleared to 0 by software once set. this bit is set by ha rdware only. i2cst.4: i2ctoi i 2 c timeout interrupt flag. this bit is set to 1 if either the i 2 c controller cannot generate a start condition or the i 2 c scl low time has expired the timeout value specified in i2cto reg ister. this happens when the i 2 c controller is operating in master mode and some other device on the bus is using the bus or holding scl low for an extended period of time. this bi t must be cleared to 0 by software once set. setting this bit to 1 by software causes an interr upt if enabled. i2cst.5: i2cami i 2 c slave address match interrupt flag. this bit is set to 1 when the i 2 c controller receives an address that matches the contents in its slave address regist er (i2csla) during the address stage. this bit must be cleared to 0 by software once set. setting this bit to 1 by s oftware causes an interrupt if enabled. i2cst.6: i2cali i 2 c arbitration loss flag. this bit is set to 1 when the i 2 c is configured as a master and loses in the arbitration. when the master loses arbitration, the i2cmst bit is cle ared to 0. setting this bit to 1 by hardware causes an interrupt if enabled. this bit must be cleared t o 0 by software once set. this bit is set by hardware only. i2cst.7: i2cnacki i 2 c nack interrupt flag. this bit is set to 1 if the i 2 c transmitter receives a nack from the receiver. setting this bit to 1 by hardware causes an interrupt if en abled. this bit must be cleared to 0 by software once set. this bit is set by hardware only. i2cst.8: i2cgci i 2 c general call interrupt flag. this bit is set to 1 when the general call is enabled (i2cgcen = 1) and the general call address is received. this bit must be cleared to 0 by software once set. setting this bit to 1 by software causes an interrupt if enabled. i2cst.9: i2croi i 2 c receiver overrun flag. this bit indicates a receive overrun when set to 1. this bit is set to 1 if the receiver has already received two bytes since the last cpu read. this bit is cleared to 0 by software reading the i2cbuf. setting this bit to 1 by software causes an interrupt if enabled. writing 0 to this bit does not clear the interrupt. i2cst.10: i2cscl i 2 c scl status. this bit reflects the logic state of the scl signal. this bit is set to 1 when scl is at a logic-high (1), and cleared to 0 when scl is at a logic-low (0). th is bit is controlled by hardware and is read-only. i2cst.11: i2cspi i 2 c stop interrupt flag. this bit is set to 1 when a stop condition (p) is detected. this bit must be cleared to 0 by software once set. setting this bit to 1 by software causes an interrupt i f enabled. i2cst.[13:12]: reserved reserved. reads return 0. i2cst.14: i2cbusy i 2 c busy. this bit is used to indicate the current status of the i 2 c module. the i2cbusy is set to 1 when the i 2 c controller is actively participating in a transaction or whe n it does not have control of the bus. this bit is controlled by hardware and is read only. i2cst.15: i2cbus i 2 c bus busy. this bit is set to 1 when a start/repeated start condition is de tected and cleared to 0 when the stop condition is detected. this bit is reset to 0 on a ll forms of reset and when i2cen = 0. this bit is controlled by hardware and is read-only. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 44 ______________________________________________________________________________________ special function register bit descriptions (continued) i2cie (02h, 04h) i 2 c interrupt enable register (16-bit register) initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write access. i2cie.0: i2csrie i 2 c start interrupt enable. setting this bit to 1 causes an interrupt to the cpu when a start condition is detected (i2csri = 1). clearing this bit to 0 disables the s tart detection interrupt from generating. i2cie.1: i2ctxie i 2 c transmit complete interrupt enable. setting this bit to 1 causes an interrupt to the cpu when the transmit interrupt flag is set (i2ctxi = 1). clearing this bit to 0 disab les the transmit interrupt from generating. i2cie.2: i2crxie i 2 c receive ready interrupt enable. setting this bit to 1 causes an interrupt to the cpu when the receive interrupt flag is set (i2crxi = 1). clearing this bit to 0 disabl es the receive interrupt from generating. i2cie.3: i2cstrie i 2 c clock stretch interrupt enable. setting this bit to 1 generates an interrupt to the cpu when the clock stretch interrupt flag is set (i2cstri = 1). clearing this bit d isables the clock stretch interrupt from generating. i2cie.4: i2ctoie i 2 c timeout interrupt enable. setting this bit to 1 causes an interrupt to the cpu when a timeout condition is detected (i2ctoi = 1). clearing this bit to 0 dis ables the timeout interrupt from generating. i2cie.5: i2camie i 2 c slave address match interrupt enable. setting this bit to 1 causes an interrupt to the cpu when the i 2 c controller detects an address that matches the i2csla value (i2cami = 1). c learing this bit to 0 disables the address match interrupt from generatin g. i2cie.6: i2calie i 2 c arbitration loss enable. setting this bit to 1 causes an interrupt to the cpu when the i 2 c master loses in an arbitration (i2cali = 1). clearing this bit to 0 disables the arbitration loss interrupt from generating. i2cie.7: i2cnackie i 2 c nack interrupt enable. setting this bit to 1 causes an interrupt to the cpu when a nack is detected (i2cnacki = 1). clearing this bit to 0 disables the nack detectio n interrupt from generating. i2cie.8: i2cgcie i 2 c general call interrupt enable. setting this bit to 1 generates an i2cgci (general call interrup t) to the cpu when general call is enabled (i2cgcen = 1). clearing this bit to 0 disables the general call interrupt from generating. i2cie.9: i2croie i 2 c receiver overrun interrupt enable. setting this bit to 1 causes an interrupt to the cpu when a receiver overrun condition is detected (i2croi = 1). clearing this bit to 0 di sables the receiver overrun detection interrupt from generating. i2cie.10: reserved reserved. reads return 0. i2cie.11: i2cspie i 2 c stop interrupt enable. setting this bit to 1 causes an interrupt to the cpu when a stop condition is detected (i2cspi = 1). clearing this bit to 0 disables the stop detection interrupt from generating. i2cie.[15:12]: reserved reserved. reads return 0. tb0r (04h, 04h) timer b 0 capture/reload value initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. tb0r.[15:0]: timer b capture/reload bits 15:0. this register is used to capture the tb0v value when timer b is configured in capture mode. this register is also used as the 16-bit relo ad value when timer b is configured in autoreload mode. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 45 special function register bit descriptions (continued) tb0c (05h, 04h) timer b 0 compare initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. tb0c.[15:0]: timer b compare bits 15:0. this register is used for comparison versus the tb0v value when timer b is operated in compare mode. scon1 (06h, 04h) serial port 1 control register initialiation: the serial port control is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. scon1.0: ri receive interrupt flag. this bit indicates that a data byte has been received in the seria l-port buffer. the bit is set at the end of the 8th bit for mode 0, after the last sample of the incoming stop bit for mode 1 subject to the value of the sm2 bit, or after the last sample of rb8 for modes 2 and 3. this bit must be cleared by software once set. scon1.1: ti transmit interrupt flag. this bit indicates that the data in the serial-port data buffer has b een completely shifted out. it is set at the end of the last data bit for al l modes of operation and must be cleared by software once set. scon1.2: rb8 9th received bit state. this bit identifies the state of the 9th bit of received data in seri al-port modes 2 and 3. when sm2 is 0, it is the state of the stop bit in mode 1. this bit has no meaning in mode 0. scon1.3: tb8 9th transmission bit state. this bit defines the state of the 9th transmission bit in serial-por t modes 2 and 3. scon1.4: ren receive enable ren_1 = 0: serial port 1 receiver disabled. ren_1 = 1: serial port 1 receiver enabled for modes 1, 2, and 3. initiate synchronous reception for mode 0. scon1.5: sm2 serial port 1 mode bit 2. setting this bit in mode 1 ignores reception if an invalid st op bit is detected. setting this bit in mode 2 or 3 enables multiprocessor communicati ons, and prevents the ri bit from being set and the interrupt from being asserted if the 9th bit receiv ed is 0. this bit also used to support mode 0 for clock selection. sm2 = 0: clock is divided by 12. sm2 = 1: clock is divided by 4. scon1.6: sm1 serial port 1 mode bit 1 scon1.7: sm0/fe serial port 1 mode bit 0/framing error flag. when fede is 0, this bit is sm0. when fede is set to 1, this bit is the fe flag that is set upon detection of an invalid s top bit. it must be cleared by software. modification of this bit when fede is set has no effect on the serial mode. see the table in the scon0.7 bit description for guidelines. sbuf1 (07h, 04h) serial data buffer 1 initialiation: this buffer is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. sbuf1.[7:0]: serial data buffer 1 bit 7:0. data for serial port 1 is read from or written to this location. the serial transmit and receive buffers are separate but both are addressed at this location. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 46 ______________________________________________________________________________________ special function register bit descriptions (continued) smd1 (08h, 04h) serial port mode register 1 initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write. smd1.0: fede framing-error-detection enable. this bit selects the function of sm0 (scon1.7). fede = 0: scon1.7 functions as sm0 for serial-port mode selection. fede = 1: scon1.7 is converted to the fe flag. smd1.1: smod serial port 1 baud-rate select. the smod selects the final baud rate for the asynchronous mode. smod = 1: 16 times the baud clock for mode 1 and 3; 32 times the system clock for mode 2. smod = 0: 64 times the baud clock for mode 1 and 3; 64 times the system clock for mode 2. smd1.2: esi enable serial port 1 interrupt. setting this bit to 1 enables interrupt requests generated by t he ri or ti flags in scon1. clearing this bit to 0 disables the serial-port interrupt. smd1.[7:3]: reserved reserved. reads return 0. pr1 (09h, 04h) phase register 1 initialiation: the phase register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. pr1.[15:0]: phase register 1 15:0. this register is used to load and read the 16-bit value in the phase regis ter that determines the baud rate for the serial port 1. tb0cn (0ah, 04h) timer b 0 control initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. tb0cn.0: cp/ rlb capture/reload select. this bit determines whether the capture or reload function is used for timer b. timer b functions in an autoreload mode following each ov erflow/underflow. see the tfb bit description for overflow/underflow condition. setting this bit to 1 ca uses a timer b capture to occur when a falling edge is detected on tbb if exenb is 1. clearing t his bit to 0 causes an autoreload to occur when timer b overflow or a falling edge is detected on tbb if exenb is 1. it is not intended that the timer b compare functionality should be used when operating in c apture mode. tb0cn.1: etb enable timer b interrupt. setting this bit to 1 enables the interrupt from the timer b tfb and exfb flags in tb0cn. in timer b clock output mode (tboe = 1), the timer overflow flag (tfb) is still set on an overflow; however, the tboe = 1 condition prevents this fla g from causing an interrupt when etb = 1. tb0cn.2: trb timer b run control. this bit enables timer b operation when set to 1. clearing this bit to 0 halts timer b operation and preserves the current count in tb0v. tb0cn.3: exenb timer b external enable. setting this bit to 1 enables the capture/reload function on the tbb pin for a negative transition (in upcounting mode). a reload results in tb0v being reset to 0000h. clearing this bit to 0 causes timer b to ignore all external eve nts on tbb pin. when operating in autoreload mode (cp/ rlb = 0) with the pwm output functionality enabled, enabling the tbb input function (exenb = 1) allows the pwm output negative transiti ons to set the exfb flag. however, no reload occurs as a result of the external negative-edge detectio n. tb0cn.4: dcen down-count enable. this bit, in conjunction with the tbb pin, controls the direction that ti mer b counts in 16-bit autoreload mode. clearing this bit to 0 causes timer b to count up only. setting this bit to 1 enables the up/down counting mode (i.e., it causes timer b to count up if the tbb pin is 1 and to count down if the tbb pin is 0). when timer b pwm output mo de functionality is enabled along with up/down counting (dcen = 1), the up/down count control of ti mer b is controlled internally based upon the count in relation to the regi ster settings. in the compare modes, the dcen bit controls whether the timer counts up and re sets (dcen = 0), or counts up and down (dcen = 1). downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 47 special function register bit descriptions (continued) tb0cn.5: tboe timer b output enable. setting this bit to 1 enables the clock output function on the tba pin if c/ t b = 0. timer b rollovers do not cause interrupts. clearing this bit to 0 allows the tba pin to function as either a standard port pin or a counter input for tim er b. tb0cn.6: exfb external timer b trigger flag. when configured as a timer (c/ t b = 0), a negative transition on the tbb pin causes this flag to be set if (cp/ rlb = exenb = 1) or (cp/ rlb = dcen = 0 and exenb = 1) or (cp/ rlb = 0 and exenb = 1 and tbcs:tbcr <> 00b). when configured in an y of these ways, this flag can be set independent of the state of the trb bit (e.g., exfb ca n still be set on detection of a negative edge when trb = 0). when cp/ rlb = 0 and dcen = 1 and tbcs:tbcr = 00b, exfb toggles whenever timer b underflows or overflows. an overflow/underflow condition is the same as described in the t fb bit description. in this mode, exfb can be used as the 17th timer bit and does not cause an interrupt. if set by a negative transition, this flag must be cleared by software. setting this bit to 1 forces a timer interrupt if enabled. tb0cn.7: tfb timer b overflow flag. this bit is set when timer b overflows from tbr or the count is equal to 0000h in down-count mode. it must be cleared by software. timer b clock prescaler bits 2:0. the tbps[2:0] bits select the clock prescaler applied to the system clock input to timer b. the tbps[2:0] bits should be configured b y the user when the timer is stopped (trb = 0). while hardware does not prevent changing the tbps[2:0] bits when the timer is running, the resultant behavior is indeterministic. timer b clock = system clock/2 (2 x tbps[2:0]) tbps[2:0] timer b input clock 000 sysclk/1 001 sysclk/4 010 sysclk/16 011 sysclk/64 100 sysclk/256 101 sysclk/1024 tb0cn.[10:8]: tbps[2:0] 11x sysclk/1 tb0cn.11: tbcr tbb pin output reset mode tb0cn.12: tbcs tbb pin output set mode. these mode bits define whether the pwm-mode output function is enabled on the tbb pin, the initial output starting state, and what compare-mo de output function is in effect. note that the tbb pin still has certain input functionalit y when the pwm output function is enabled. tb0cn.[14:13]: reserved reserved. reads return 0. tb0cn.15: c/tb counter/timer select. this bit determines whether timer b functions as a timer or counter. setti ng this bit to 1 causes timer b to count negative transitions on the tba pin. cl earing this bit to 0 causes timer b to function as a timer. the speed of timer b is determi ned by the tbps[2:0] bits of tb0cn. tb0v (0bh, 04h) timer b 0 value initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write. tb0v.[15:0]: timer b value bits 15:0. this register is used to load and read the 16-bit timer b value. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 48 ______________________________________________________________________________________ special function register bit descriptions (continued) i2ccn (0ch, 04h) i 2 c control register (16-bit register) initialiation: this register is cleared to 0000h on all forms of reset. the i2cstart and i2cstop bits are reset to 0 when i2cmst = 0 or when i2cen = 0. i2cstart and i2cstop are mutuall y exclusive operations. user software can only set one of these bits at any given ti me. i2crst is reset to 0 when i2cen = 0. read/write access: unrestricted read. unrestricted write access when i2cbusy = 0. wri tes to i2cmst, i2cmode are ignored when i2cbusy = 1. writes to i2cen are normally disabled when i2cbus y = 1. however, when i2crst = 1, i2cen can be written to even when i2cbusy = 1. writes to i2cack are ignored when i2crst = 1. i2ccn.0: i2cen i 2 c enable. this bit enables the i 2 c function. when set to 1, the i 2 c communication unit is enabled. when cleared to 0, the i 2 c function is disabled. i2ccn.1: i2cmst i 2 c master mode enable. the i2cmst bit functions as a master mode enable bit for the i 2 c module. when the i2cmst bit is set to 1, the i 2 c operates as a master. when the i2cmst is cleared to 0, the i 2 c module operates in slave mode. this bit is automatically cleared whene ver the i 2 c controller receives a slave address match (i2cami = 1), loses arbitrat ion (i2cali = 1), or receives a general call (i2cgci = 1). i2ccn.2: i2cmode i 2 c transfer mode. the transfer mode bit selects the direction of data transfer with respect to th e master. when the i2cmode bit is set to 1, the master is operating in receiver mode (reading from slave). when the i2cmode bit is cleared to 0, the master is operating in transmitter mode (writing to slave). note that software writing to this bit is prohibited in slav e mode. when operating in master mode, software configures this bit to the desired directio n of data transfer. when operating in slave mode, the direction of data transfer is determined by the r/ w bit received during the address stage and this bit reflects the actual r/ w bit value in the current transfer and is set by hardware. software writing to this bit in slave mode is igno red. i2ccn.3: reserved reserved. do not write a 1 to this location. functionally, this is the i2cea bit, however, ther e are problems with the i 2 c extended addressing mode. i2ccn.4: i2cstrs i 2 c clock stretch select. setting this bit to 1 enables clock stretching after the falling edge of the 8th clock cycle. clearing this bit to 0 enables clock st retching after the falling edge of the 9th clock cycle. this bit has no effect when clock stretching is disab led (i2cstren = 0). i2ccn.5: i2cack i 2 c data acknowledge bit. this bit selects the acknowledge bit returned by the i 2 c controller while acting as a receiver. setting this bit to 1 generates a nack (leaving sda h igh). clearing the i2cack bit to 0 generates an ack (pulling sda low) during the acknowledgeme nt cycle. this bit retains its value unless changed by software or hardware. whe n an i 2 c abort is in progress (i2crst = 1), this bit is set to 1 by hardware and software writes to thi s bit are ignored when i2crst = 1. i2ccn.6: i2cstart i 2 c start enable. setting this bit automatically generates a start condition when the bus i s free or generates a repeated start condition during a transfer where the i 2 c module is operating as the master. this bit is automatically self-cleared to 0 after the start condition h as been generated. if the i 2 c start interrupt is enabled, a start condition generates an interrupt to the cpu. in master mode, setting this bit could also start the timeout timer if enabled. if the timeout timer expires before the start condition can be generated, a timeout interru pt is generated to the cpu if enabled. the i2cstart bit is also cleared to 0 by the timeout event. note that this bit has no effect when the i 2 c is operating in slave mode (i2cmst = 0) and is reset to 0 when i2cmst = 0 or i2cen = 0. also, the i2cstart and i2cstop are mu tually exclusive. if both bits are set at the same time, it is considered as an invalid operat ion and the i 2 c controller ignores the request and resets both bits to 0. setting the i2cstar t bit to 1 while i2cstop = 1 is an invalid operation and is ignored, leaving the i2cstart bit cleared to 0. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 49 special function register bit descriptions (continued) i2ccn.7: i2cstop i 2 c stop enable. setting this bit to 1 generates a stop condition. this bit is autom atically self- cleared to 0 after the stop condition has been generated. in master mode, setting this bit could also start the timeout timer if enabled. if the timeout timer expires before the sto p condition can be generated, a timeout interrupt is generated to the cpu if enabled. the i2cstop bi t is also cleared to 0 by the timeout event. note that this bit has no effect when the i 2 c is operating in slave mode (i2cmst = 0) and is reset to 0 when i2cmst = 0 or i2cen = 0. setting the i2cstop bit to 1 while i2cstart = 1 is an invalid operation and is ignored, leaving the i2cstop bit cleared to 0. i2ccn.8: i2cgcen i 2 c general call enable. setting this bit to 1 enables the i 2 c bus to respond to a general call address (address = 0000 0000). clearing this bit to 0 disables the response to a general call address. i2ccn.9: i2cstren i 2 c clock stretch enable. setting this bit to 1 stretches the clock (hold scl low) at the end of the clock cycle specified in i2cstrs. clearing this bit disables clock stretching. i2ccn.[14:10]: reserved reserved. reads return 0. i2ccn.15: i2crst i 2 c reset. setting this bit to 1 aborts the current transaction and resets the i 2 c controller. this bit is set to 1 by software and is only cleared to 0 by hardware after the reset or when i2cen = 0. i2cck (0dh, 04h) i 2 c clock control register (16-bit register) initialiation: this register is set to 0204h on all forms of reset. read/write access: unrestricted read. write to this register is allowed only when i2cbusy = 0. this register has no function when operating in slave mode and the clock generation circui try should be disabled. i2cck.[7:0]: i2cckl[7:0] i 2 c clock low bits 7:0. these bits define the i 2 c scl low period in a number of system clocks, with bit 7 as the most significant bit. the duration of scl low time is calculated using the following equation: i 2 c low time period = system clock x (i2cckl[7:0] + 1) when operating in master mode, the i2cckl must be set to a minimum value of four to ensure proper operation. any value less than four is set to four. i2cck.[15:8]: i2cckh[7:0] i 2 c clock high bits 7:0. these bits define the i 2 c scl high period in a number of system clocks, with bit 7 as the most significant bit. the duration of scl high time is calculated using the following equation: i 2 c high time period = system clock x (i2cckh[7:0] + 1) when operating in master mode, the i2cckh must be set to a minimum value of two to ensure proper operation. any value less than two is set to two. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 50 ______________________________________________________________________________________ special function register bit descriptions (continued) i2cto (0eh, 04h) i 2 c timeout register (8-bit register) initialiation: this register is cleared to 00h on all forms of reset. read/write access: unrestricted read/write access. i2cto.[7:0]: i 2 c timeout register bits 7:0. this register is used only in master mode. this register determin es the number of i 2 c bit periods (scl high + scl low) the i 2 c master will wait for scl to go high. the timeout timer resets to 0 and starts to count after the i2cstart bit is set o r every time the scl goes low. when cleared to 00h, the timeout function is disabled and the i 2 c waits for scl to go high indefinitely during a transmission. when set to any other v alues, the i 2 c waits until the timeout expires and sets the i2ctoi flag. i 2 c timeout = i 2 c bit rate x (i2cto[7:0] + 1) note that these bits have no effect when the i 2 c module is operating in slave mode (i2cmst = 0). when operating in slave mode, scl is controlled by an external master . i2csla (0fh, 04h) i 2 c slave address register (16-bit register) initialiation: this register is cleared to 0000h on all forms of reset. read/write access: unrestricted read/write access. i2csla.[9:0]: i 2 c slave address register bits 9:0. these address bits contain the address of the i 2 c device. when a match to this address is detected, the i 2 c controller automatically acknowledges the transmitter with the i2cack bit value if the i 2 c module is enabled (i2cen = 1). the i2cami flag is set to 1 and the i2cmst bit is cleared to 0. an interrupt is generated to the cpu if enabled. i2csla.[15:10]: reserved reserved. reads return 0. peripherals this section contains detailed descriptions for eachperipheral device, however, many of the peripherals are described in detail in the maxq family user? guide . pins most of the peripheral devices on the MAXQ3108require connections to other components. to minimize the pin count, some peripherals share pins with other peripherals. obviously, only one peripheral can drive a pin at any given time. table 5 provides information on how to use these multipurpose pins. pin primary secondary tertiary comment 1 p2.0 mdin2p mosi do not enable both manchester d ecoder 2 and spi at the same time. if neither is enabled, the gpio port function is used. 2 p0.0 txd0 int0 transmit data is only presented to the pin when a character is actual ly being transmitted. to use this pin as full-time transmit data, se t the gpio port pin to output and load a 1 in the output register. do not enabl e an interrupt on this pin if it is used for the serial transmit functi on. 3 p0.1 rxd0 int1 receive data function is only operational when the associated ren bit is set is the scon0 register. do not enable an interrupt on this pin if it is used for the serial receive function. 4 p0.2 mdin1n t2p do not enable outputs or clock gating on timer 2 when manchester decoder 1 is enabled. also, do not enable int2 when manchester decoder 1 is enabled or clock gating is used on timer 2. table 5. multipurpose pin description downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 51 pin primary secondary tertiary comment 5 p0.3 mdin1p t2pb do not enable outputs or clock gating on timer 2 when manchester decoder 1 is enabled. also, do not enable int3 when manchester decoder 1 is enabled or clock gating is used on timer 2. 6 p0.4 sda int4 do not enable int4 when the i 2 c peripheral is in use. 7 p0.5 scl int5 do not enable int5 when the i 2 c peripheral is in use. 8 p2.5 cf1 enabling pulse output 1 disables gpio-port function on this p ort. 9 p2.6 cf2 enabling pulse output 2 disables gpio-port function on this p ort. 10 p1.0 tms int8 when jtag is in use, port pin 1.0 is unavailable. do not enable int8 when jtag is active. 11 p1.1 tck int9 when jtag is in use, port pin 1.1 is unavailable. do not enable int9 when jtag is active. 12 p1.2 tdi int10 when jtag is in use, port pin 1.2 is unavailable. do not enable int10 when jtag is active. 13 p1.3 tdo sqw when jtag is in use, port pin 1.3 and the sqw function are unavailable. do not enable int11 when either jtag or the sqw function is active. 14 p1.4 tbb when using tbb as an input, p1.4 must be configured as an input. 18 p1.5 tba when using tba as either an input or output, p1.5 must be configured as an input. 22 p0.7 rxd1 int7 receive data function is only operational when the associated ren bit is set is the scon1 register. do not enable an interrupt on this pin if it is used for the serial receive function. 23 p0.6 txd1 int6 transmit data is only presented to the pin when a character is actual ly being transmitted. to use this pin as full-time transmit data, se t the gpio port pin to output and load a 1 in the output register. do not enabl e an interrupt on this pin if it is used for the serial transmit functi on. 24 p1.6 rst this is an active-low reset pin. driving a low level on p1.6 ca uses the MAXQ3108 to reset. the reset function on this pin can be disabled by setting rstd to 1. 25 p2.4 mdin0p when man chester d ecoder 0 is enabled, set p2.4 as an input. 26 p2.3 mdin0n ssel when using manchester decoder 0, disable spi and set p2.3 as an input.` 27 p2.2 sclk clko when clko (system clock for the cpu core) is enabled (that is, the eclko bit is set), the spi peripheral cannot be used. 28 p2.1 mdin2n miso when the man chester d ecoder 2 is used, the spi peripheral cannot be used. the p2.1 port pin should be set to an input when using mancheste r decoder 2. table 5. multipurpose pin description (continued) clock all functional units in the MAXQ3108 are synchronizedto the system clock. the system clock can be generat- ed from an internal oscillator with a 32,768hz external crystal/resonator or an internal fll oscillator. the basic unit of time in the MAXQ3108 is the system clock peri- od. the usercore receives a system clock that is one- half the internal clock frequency. the manchesterdecoders, cubic sinc filters, and the dspcore all receive the undivided system clock. the internal clock circuitry generates the system clock from one of the two clock sources: internal oscillator with a 32,768hz external crystal or resonator downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 52 ______________________________________________________________________________________ internal fll, optionally driven by the 32,768hz exter- nal crystal or resonator the 32,768hz external crystal provides the clock refer-ence for functional units that require a fixed frequency. when the 32,768hz clock reference is used directly as the system clock, the MAXQ3108 is operating in power- saving mode. when not operating in power-saving mode, the MAXQ3108 receives its clock from the fll. because the MAXQ3108 has no way to receive a high-frequency clock from an external crystal or other source, the fll is the only source of a high-frequency clock. the fll must be selected as the clock source for normal operation. this selection is made through the fllsl bit. the fllsl bit controls selection of the inter-nal fll oscillator for system clock generation. when fllsl = 1, the internal fll oscillator is used for system clock generation. the fllsl bit is read/write accessi- ble at any time and defaults to logic 0 on power-on reset only. one of the first tasks user software should perform is to set the fllsl bit to 1.during a power-on reset, the 32,768hz crystal amplifier is automatically enabled. to disable the internal crystal amplifier, the rcnt.x32d bit must be set to 1. once the 32,768hz crystal amplifier is enabled, 250ms is required for it to warm up. the rcnt.32krdy bit is set to 1 once the 32,768hz amplifier has been given suffi- cient time to warm up. 32,768hz crystal oscillator the external 32k clock source can operate in differentmodes according to the setting of the 32k mode bits (rcnt.32kmd). in normal operation, the 32k oscillator is operating in the noise immune mode (32kmd = 00), which is more tolerant to system noise. if the system is operating in a very quiet environment, the oscillator can be switched to quiet mode (32kmd = 01) with reduced current consumption. note that in this mode, the oscilla- tor is subject to system noise and may not be desirable for very accurate timing requirement. for applications where low stop-mode current is desired, there is an option to invoke the quiet mode operation during stop mode. when 32kmd = 1x, the quiet mode is invoked on entry to stop mode. if 32kmd = 10 and 32k is enabled (x32d = 0), the cpu is held in stop mode until the 32k oscillator has warmed up (32krdy = 1). if 32kmd = 11, the cpu starts execution from the selected clock source after the required fll cycles requirement, in parallel with the oscillator warmup (transition from quiet mode to noise immune mode). when the 32k input is enabled (x32d = 0), changes ofthe 32kmd bits reset the 32krdy bit if the 32k circuitry is already opening in the quiet mode and the new set- ting requires to change to noise immune mode. when the oscillator is operating in quiet mode, no warmup time is required and, therefore, 32krdy is always set to 1. if the operation mode is changed to noise immune mode from the quiet mode, the 32krdy bit is reset to 0. the 32krdy bit is set to 1 after the necessary warmup time requirement. frequency-locked loop (fll) the internal fll offers the least expensive solution forclock generation. the fll provides a maximum fre- quency of 306 times the cx1 input clock (32.768khz x 306 = 10.027mhz) with 5% when locked with 32.768khz quartz crystal source. the lock period forthe fll is about 64 cycles of the cx1 input clock (approximately 2ms). controlling the fll: the fll has a lock-enable bit (fllen) to initiate the locking mechanism to the 32kinput source. the flock bit indicates to the user that the fll is locked and ready to be used. the fll has a short warmup period where the fll is running but is not locked. the flock bit indicates that the fll is running and locked to the cx1 input. the fll oscillator clock is divided down according to the pmme. internal clocks are generated directly from the system clock. normally, the system clock is sourced from one of the two clock sources. the effect of the pmme and cd bits on the system clock in the MAXQ3108 is sum- marized in table 6. when the 32,768hz clock is selected as the system clock source (pmme, cd1, cd0 = 111b), the system is running at pmm2 mode and all functional units are run- ning synchronously. in this mode of operation, the high- frequency clock source is turned off to save power if the switchback function is not enabled (swb = 0) unless the dspcore is enabled; if the switchback is enabled (swb = 1), the high-frequency clock source is not turned off (see the pmme bit description for more information). note that debug mode does not work with pmm2 mode since switchback does not occur fast enough to guarantee proper operation. power conservation the MAXQ3108 incorporates power-management fea-tures that support low-power operation with three power-saving modes. features include startup timer, internal fll oscillator, and switchback function. the MAXQ3108 was developed for low-power applica- tions and has three different levels of power-saving downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 53 modes. the two power-management modes reducespeed and power consumption by either internally dividing the clock signal by 256 or using the 32khz clock directly. the stop mode stops all internal clocks (with the exception of the 32khz crystal amplifier) resulting in a static condition and providing the lowest power state. the power supervisor monitors the v dd level when power is first applied to the device and generates apower-on reset when the voltage reaches an accept- able level, and following the 65,536 fll cycle power-up period. the power-on reset initializes the processor and allows program execution at the reset vector location of 8000h. the power-on reset flag, por, is set to logic 1 to indicate a power-on reset has occurred; the por flag can only be cleared by software. power-management mode power-management mode (pmm) allows applicationsoftware to dynamically match operating frequency with the need for lower operating power when full process- ing throughput is not required. when power-manage- ment mode 1 (pmm1) is used, the system clock is divided by 256, resulting in a user core clock rate of 19.584khz. when power-management mode 2 (pmm2) is used, the system clock is driven directly by the 32,768hz clock source resulting in a user core clock of 16.384khz. pmm reduces operating power by minimizing power loss due to cmos switching transients. pmm is invoked by setting the pmm enable bit (pmme). the pmme bit defaults to 0 on all forms of reset. when the system is operated in pmm2 mode, the high- frequency clock is disabled unless the switchback is active or the dspcore is enabled. refer to the pmme bit description in the maxq family user? guide for more information. switchback the switchback feature allows low-power operationassociated with pmm, but maintains quick response to events that require full processing capacity. the switch- back function is enabled by setting the swb bit to logic 1. when operating in a pmm mode and the swb bit is enabled, the system restores the clock settings that were active when pmm was invoked whenever the sys- tem detects a qualified event. the automatic switchback is only enabled when pmm is in use. switchback to the high-frequency clock occurs whenever any of these conditions occur: detection of a selected edge transition on any of the external interrupts when the respective pin has inter-rupts enabled. uart activity: when the serial port is enabled to receive data and a transition occurs on the receive input pin (formode 1, 2, and 3). after a write access to the sbuf register. spi activity: spib is written in master mode (stby = 1). ?he ssel signal is asserted in slave mode. time-of-day alarm or subsecond alarm from the rtc when enabled. ? 2 c activity: start interrupt when enabled (i2csrie = 1). a write to the i2cstart bit when the i 2 c controller is in master mode (i2cmst = 1). svm interrupt if enabled (svmie = 1). changing the value of adconv from 0 to 1. active debug mode is entered either by breakpoint match or issuance of the debug command frombackground mode. pmme cd[1:0] divide ratio clock source 0 00 1 (default) fllsl 0 01 2 fllsl 0 10 4 fllsl 0 11 8 fllsl 1 00 256 fllsl 1 01 reserved (256) fllsl 1 10 reserved (256) fllsl 1 11 1 cx1 table 6. MAXQ3108 clock divisors downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 54 ______________________________________________________________________________________ since pmm is incompatible with any operation thatrequires a precise clock (for example, baud-rate gener- ation), attempts to set the pmme bit while such opera- tions are active will fail. note that when switchback is enabled in pmm2 mode, the high-frequency clock (the fll) continues to run to support the switchback operation. stop mode the stop-mode bit is only implemented for theMAXQ3108 usercore (the dspcore does not support stop mode). stop mode disables all circuits within the processor except the 32,768hz crystal amplifier and any circuitry that is directly clocked by the 32,768hz oscillator. all other on-chip clocks, timers, and serial port communication are stopped, and no processing is possible. once in stop mode, the device is in a static state, its power consumption primarily dominated by leakage current. stop mode is invoked by setting the stop bit to logic 1. the processor enters the stop mode on the instruction that sets the stop bit. entering the stop mode does not affect the setting of the clock control bits, allowing the system to return to its original operating frequency after stop mode is exited. if reset ends stop mode, the clock generation logic is returned to its default condition. the processor can exit stop mode through the following: by using any of the external interrupts that are enabled. by external reset through the rst pin. by the time-of-day alarm or subsecond alarm from the rtc. by the i 2 c start interrupt if enabled (i2csrie = 1 and i2cen = 1). by the svm interrrupt if enabled (svmie = 1). when stop mode is exited, the processor resumes its normal execution. when the usercore invokes stop mode, the dspcore is disabled in hardware. this means that on any exit from stop mode, the dsp must be reconfigured and reenabled if this functionality is desired. this also means that user code may need to handle an interrupt source differently depending on whether it occurs while both cpus are running or whether it removes stop mode. idle mode idle mode is only implemented for the MAXQ3108dspcore (not the usercore). idle mode suspends the processor by holding the instruction pointer (ip) in a static state. no instructions are fetched and no pro- cessing occurs. setting the idle bit to logic 1 invokes the idle mode. the instruction that executes this step isthe last instruction prior to freezing the program counter. once in idle mode, all resources are pre- served and clocks remain active to enabled peripherals so the processor can exit the idle state using any of the interrupt sources that are enabled. note that the only interrupts associated with the dspcore (i.e., those that can remove idle mode) are master request (from usercore), and adc output buffer interrupts. the idle bit is cleared automatically once the idle state is exited; allowing the processor to execute the instruction at the corresponding interrupt vector address. upon returning from the interrupt vector, the processor executes the instruction that immediately follows the one that set the idle bit. resetting the processor also removes the idle mode. reset places the processor in a reset state and clears the idle bit. the dspcore reset state could result from a global system reset or from clearing of the endsp bit by the usercore. reset the MAXQ3108 has four ways of entering a reset state: power-on reset watchdog timer reset external reset internal system reset regardless of the reset source, the state of the MAXQ3108 is the same while in reset. when in reset, the oscillator/fll oscillator is running, but no program execution is allowed. when the reset source is external, the user must remove the reset stimulus. when power is applied to the device, the power-on delay removes the stimulus automatically. power-on reset/brownout reset generation the MAXQ3108 incorporates an internal voltage refer-ence and comparator in order to monitor v dd and hold the device in reset if the supply is out of tolerance.once v dd has risen above the threshold, the MAXQ3108 generates a power-on reset, starts the inter-nal fll, and counts 65,536 fll cycles (por delay) before program execution begins at location 8000h. the power monitor invokes the reset state whenever the supply drops below the por threshold. this reset con- dition remains until the supply voltage is above the min- imum operating voltage level. when power returns above the reset threshold, a full power-on reset is per- formed. thus, a brownout that causes v dd to drop below the minimum voltage appears the same as apower-up. the MAXQ3108 provides a brownout detect/reset func- tion. brownout detection is always enabled during downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 55 active mode. the power monitor invokes a brownoutreset state to halt program execution when v dd drops below the threshold condition. this ensures that themicrocontroller is safely placed into a reset state when- ever v dd < v rst , thus preventing possible code execu- tion while the supply voltage is too low. when powerreturns above the reset threshold, and once the internal por delay (65,536 fll cycles) is satisfied, the device is initialized just as though power was removed and reapplied. the processor exits the reset condition automatically once v dd meets the minimum voltage requirement. software can determine that a power-on reset hasoccurred by checking the power-on reset (por) flag in the wdcn register. software should clear the por bit after reading it. the brownout detect function can be disabled during stop mode using the brownout disable (bod) bit in the pwcn register. the por default state for the bod bit is 0, which enables the brownout detect function during stop mode. if brownout detection is disabled during stop mode, the circuitry responsible for detecting a brownout condition is shut down and the v dd < v rst condition does not invoke the reset state. since func-tionality of the device is not guaranteed when v dd MAXQ3108 can be disabled by user application code. the power-on-reset default condition is for the rst pin to be enabled. some applications, however, may not use thereset input function or may use the alternate function assigned to the pin. the reset function on the external pin can be disabled by setting the rstd bit of the pwcn register to a logic 1. since the por default con- dition for the device results in the rst function being enabled on the pin, users should be cautioned thatholding the pin low on power-up prevents exiting of the reset state and the ability to execute the code neces- sary to disable the rst function. when the reset func- tion is enabled on the rst pin, user code can generate a reset by writing a 0 to the port pin. peripheral devices gpio ports the MAXQ3108 contains three gpio ports: p0, p1, andp2. internally, each of these ports is 8 bits wide; howev- er, not all bits of all ports are connected to pins. port p0 exposes bits 0 to 7, port p1 exposes bits 0 to 6, and port p2 exposes bits 0 to 5. writes to unused bits have no effect. reads from unused bits could be in an inde- terminate state. for information on using gpio ports, refer to section 6 of the maxq family user? guide . uarts the MAXQ3108 contains two uarts (universal syn-chronous/asynchronous receiver/transmitters). most often, these are used as standard asynchronous serial ports for console applications; however, they are quite flexible and can be used in a variety of ways. each port can be configured through the control regis- ter (sconx) and the mode register (smdx). the baud rate is established by programming an appropriate value in the phase register (prx). finally, communica- tion is performed by writing and reading the buffer reg- ister (sbufx). details on using these ports can be found in section 10 of the maxq family user? guide . note that the multi- processor support mentioned in this document is not supported by the serial ports implemented in theMAXQ3108. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 56 ______________________________________________________________________________________ infrared support uart channel 0 on the MAXQ3108 contains a specialfeature that eases its use with some infrared communi- cation systems. in these systems, an asynchronous ser- ial signal is used to on-off modulate a high-frequency carrier signal. this modulated carrier is then used to further modulate an ir beam. because of the popularity of infrared remote controls, the receivers for this sort of modulated signal are readily available and inexpensive. signal description: to convert an asynchronous sig- nal into a signal suitable for ir transmission, the modu-lated ir beam is typically turned on during ??bit times, and is turned off during ??bit times. for conventional serial data, this means that the ir beam is on only when data is actually being transmitted, and is off at all other times. see figure 2. because drivers for the ir led used as a transmitter vary, there are two additional bits in the smd0 register to configure the output signal. the first is the epwm bit. when set, the output of the lower half of timer 2 is mixed with the transmitted serial data signal. the result- ing waveform has the output frequency from the timer when the data signal is low, and has either a low or high level when the data signal is high. the state of the output when the serial data signal is high is set by the ofs bit in the smd0 register. when the ofs bit is 0, the txd0 pin is low when the serial data signal is high; when the ofs bit is 1, the txd0 pin is high when the serial data signal is high. the carrier frequency is generated by the low half of timer 2 configured as two 8-bit timers. see the timer 2 and timer b sections for more information about config- uring this timer. spi the MAXQ3108 contains an spi peripheral that can beconfigured as either a master or a slave. for information on the spi peripheral, refer to section 11 of the maxq family user? guide . note that the spi peripheral is not available when the adc channels are used, since theyshare pins. i 2 c interface the MAXQ3108 contains an i 2 c peripheral. the i 2 c bus is an 8-bit, bidirectional, 2-wire serial bus interfacewith the following characteristics: compliant with philips semiconductor i 2 c bus speci- fication version 2.1 (2000). information is transferred through a serial data bus (sda) and a serial clock line (scl). operates in either master or slave mode as transmit- ter or receiver. supports a multimaster environment. supports 7-bit and 10-bit addressing modes. data transfer rate of up to 100kbps in standard mode and up to 400kbps in fast mode. on-chip filtering rejects spikes on the bus data line to preserve data integrity. supports maximum bus capacitance of 400pf. a transfer sequence, in its simplest form, is composed of a start bit (s), the slave address, a r/ w bit, and an address-acknowledge bit (a) followed by data, a data-acknowledge bit (a), and a stop bit (p). one party, the master, initiates the sequence and governs the timing. epwm = 0 epwm = 1, ofs = 0epwm = 1, ofs = 1 figure 2. ir option on uart 0 downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 57 the other party, the slave, recognizes its address andresponds by accepting data or delivering data. a data transfer sequence can be grouped into the following stages: start: the master generates the start condition (s) by pulling sda low (high-to-low transition) whileholding scl high. address: the master transmits the address of the slave device, together with the direction of datatransfer (r/ w ). address acknowledge: the slave with the matching address responds to the master by holding sda lowduring the 9th clock scl high (a). data: the transmitter sends data to the receiver. the number of bytes of data is unlimited. however, eachdata byte must be followed by a data-acknowledge bit (a). data acknowledge: the receiver acknowledges to the transmitter by sending the acknowledge bit (a). ifthe master is the receiver and the data just received is the last byte expected, the master leaves sda high to signal to the slave transmitter that the last byte of expected data is transmitted. the slave trans- mitter then releases sda after the 9th clock so that the master can generate a stop or start condition. stop: the master concludes the transfer by send- ing the stop condition (p) by causing a low-to-hightransition on sda while scl is high. the i 2 c bus is now idle. the MAXQ3108 i 2 c peripheral uses seven registers to manage i 2 c bus communication: i2cbuf: the buffer register through which all out- bound data is written, and through which all inbounddata is received. i2cck: the i 2 c clock register defines the high and low periods for the scl signal. i2ccn: the control register manages the i 2 c periph- eral during configuration and operation. i2cst: the status register contains bits that reflect the condition of the i 2 c peripheral. it is consulted fre- quently during i 2 c operation. i2cie: the interrupt enable register is used to man- age interrupt sources within the i 2 c peripheral. i2cto: the timeout register defines how long a slave can extend the i 2 c clock before the peripheral declares a timeout. i2csla: establishes the slave address for the i 2 c peripheral. i 2 c use scenario: MAXQ3108 master sends 2 bytes to slave 1) set the i2cen and i2cmst bits in the i2ccn regis- ter. this enables the i 2 c peripheral and establishes the MAXQ3108 as master. 2) set the i2cstart bit in the i2ccn register. this causes the MAXQ3108 to send the startsequence. when the start condition has been sent (and both sda and scl are low), the i2cstart bit is cleared. note that the i2csri bit is set in the i2cst register as well. that is because the i 2 c peripheral sees its own start condition. 3) load the command byte into i2cbuf. the com- mand byte consists of the slave address and ther/ w bit. for this example, assume we wish to write to slave address 0x30. the byte to be loaded in thiscase is 0x60: the address shifted up by one posi- tion and bit 0 (the r/ w bit) set to 0. 4) monitor the i2ctxi flag in the i2cst register. when set, the i 2 c peripheral has finished sending the command byte and has received an ack or a nakfrom the remote device. check the i2cnacki flag in the i2cst register to determine if an ack or a nak was received. if set, the command was not acknowl- edged. clear these bits after they are tested. 5) load the first data byte into i2cbuf. 6) monitor the i2ctxi flag in the i2cst register. when set, the i 2 c peripheral has finished sending the data byte. check the i2cnacki flag to ensure thatthe slave has received the byte. clear both these bits. 7) load the second data byte into i2cbuf. 8) monitor the i2ctxi flag in the i2cst register. when set, the i 2 c peripheral has finished sending the data byte. check the i2cnacki flag to ensure thatthe slave has received the byte. clear both these bits. 9) set the i2cstop bit in the i2ccn register. this causes the MAXQ3108 to send the stopsequence. when this bit returns to 0, the stop sequence has been sent and the i 2 c bus is idle. i 2 c use scenario: MAXQ3108 master receives 2 bytes from slave 1) set the i2cen and i2cmst bits in the i2ccn regis- ter. this enables the i 2 c peripheral and establishes the MAXQ3108 as master. 2) set the i2cstart bit in the i2ccn register. this causes the MAXQ3108 to send the startsequence. when the start condition has been downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 58 ______________________________________________________________________________________ sent (and both sda and scl are low), thei2cstart bit is cleared. note that the i2csri bit is set in the i2cst register as well. that is because the i 2 c peripheral sees its own start condition. 3) load the command byte into i2cbuf. the com- mand byte consists of the slave address and ther/ w bit. for this example, assume we wish to write to slave address 0x30. the byte to be loaded in thiscase is 0x60: the address shifted up by one posi- tion and bit 0 (the r/ w bit) set to a one. 4) monitor the i2ctxi flag in the i2cst register. when set, the i 2 c peripheral has finished sending the command byte and has received an ack or a nakfrom the remote device. check the i2cnacki flag in the i2cst register to determine if an ack or a nak was received. if set, the command was not acknowledged. clear these bits after they are test- ed. 5) set the i2cack bit to 0 to acknowledge the first byte. 6) monitor the i2crxi flag in the i2cst register. when set, the i 2 c peripheral has finished receiving the data byte and has sent the ack. read the datafrom the i2cbuf register and clear the i2crxi bit. 7) clear the i2cack bit to nak the next received byte. 8) monitor the i2crxi flag in the i2cst register. when set, the i 2 c peripheral has finished receiving the data byte and has sent the nak. read the datafrom the i2cbuf register and clear the i2crxi bit. 9) set the i2cstop bit in the i2ccn register. this causes the MAXQ3108 to send the stopsequence. when this bit returns to 0, the stop sequence has been sent and the i 2 c bus is idle. i 2 c use scenario: MAXQ3108 slave receives 2 bytes from external master 1) set the i2cen bit in the i2ccn register. this enables the i 2 c peripheral. 2) set the slave address in the i2csla register. 3) monitor i2cst. as conditions change on the i 2 c bus, they are reflected in the i2cst register. whenthe i2cami bit is set, the address of the MAXQ3108 has been matched. the MAXQ3108 automatically sends ack when an address matches. 4) set the i2cack bit to 0 to ack the received bytes. 5) monitor the i2crxi and the i2cspi flags in the i2cst register. when the i2crxi bit is set, the i 2 c peripheral has finished receiving the data byte andhas sent the ack. read the data from the i2cbuf register and clear the i2crxi bit. 6) when the i2cspi flag is set, the i 2 c peripheral has detected a stop condition. no more characters areto be expected. adc inputs the MAXQ3108 contains six cubic sinc filters thatreceive decoded bit streams from three manchester decoders. the adc hardware is unique in that most of the functions can be performed by either the usercore or the dspcore. this section describes how these adc inputs are configured. see figure 3. the input to the manchester decoder is a composite signal consisting of two delta-sigma modulator chan- nels and a synchronization signal. the decoder extracts the clock and data and presents the signals to a sync detector. this block searches for the synchro- nization pattern and keeps a shift register in step with the synchronized signal. when the sync detector is asserting a lock indication, the recovered channel 0 and 1 outputs reflect two analog inputs at the adc modulator. these recovered bit streams are presented to cubic sinc filters for conversion to digital format. the filters themselves have 24-bit resolution; however, the number of bits that are actually significant depends directly on the oversampling rate used in the filter control logic. sync detector manchester decoder clock mdinxp lock ? ch0 ? ch1 mdinxn data figure 3. adc bit stream decoder downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 59 adc registers ad0 to ad5: these six registers contain the most significant 16 bits for the cubic sinc filters. ad0 andad1 correspond to manchester decoder 0, ad2 and ad3 correspond to manchester decoder 1, and ad4 and ad5 correspond to manchester decoder 2. ad0lsb to ad5lsb: these six registers contain the least significant 8 bits for the cubic sinc filters. pairedwith the ad0 to ad5 registers, each cubic sinc filter has 24 bits of resolution. adcn: the adc control register contains both con- trol bits and status bits associated with the adc. theregister contains bits that configure the oversampling rate, and enable or disable individual manchester decoder channels and interrupts and other functions. adcc: this register contains a measure of the clock rate associated with a particular manchesterdecoder. because the speed of a manchester chan- nel is controlled not by the MAXQ3108 but by the unsynchronized clock of an external device, it is criti- cal for the application to know the difference between the modulator clock and the MAXQ3108 clock. to determine this, the adcc register contains the number of sync bits that occur during 512 32.768khz clock periods. application software can use this information to determine the relative speed of the two clocks and to make correction for time-crit- ical measurements. mstc: the manchester decoder status register con- tains bits that reveal the synchronization status of allthree manchester decoders. it also contains the selection bits for the clock measurement function exposed in the adcc register. use case: using a single ds8102 as a 2-channel adcthe ds8102 is designed to operate with the manchester data inputs of the MAXQ3108. figure 4 demonstrates how simple the physical interface can be: just connect the mnout pin of the ds8102 to the mdin0p input of the MAXQ3108, and establish a com-mon ground using the mdin0n pin. this interface point, however, makes an ideal isolation interface. because of the manchester-encoded nature of the signal interface, any type of isolation?apacitive, transformer, or opti- cal?an be used to couple the output of the ds8102 to the MAXQ3108. to use the adc inputs, perform the following steps: configure the adc. in the adcn register, set the osr bits to select the desired oversampling rate,either 32, 64, 128, or 256. enable the manchester decoder 0 by setting md0e. within a few milliseconds, the md0snc bit should go active in the mstc register. this indicates that thesynchronization pattern has been detected and that samples in the ad0 register are valid. to read samples, wait for abf0 to go active in the adcn register. this indicates that samples are avail-able in the ad0 and ad1 registers. the sample input loop can be as simple as: while(true) { while(!adcn.abf0); process_sample(ad0); } dual-core interfaces the MAXQ3108 contains two maxq20 cores. the firstcore, usercore, operates at half the master clock speed and manages most of the peripheral devices. the second core, dspcore, operates at the full master clock speed and has no peripheral responsibility. it is free to handle most of the math-intensive parts of the application. the dspcore differs from the usercore in two impor- tant aspects: first, it has no debug engine; and second, it has no nonvolatile program memory. instead, the ds8102 an0+ an0- MAXQ3108 mdin0p mdin0n an1+ an1- figure 4. connecting the MAXQ3108 to a ds8102 dual delta-sigma modulator downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 60 ______________________________________________________________________________________ dspcore uses 8kb (4k instruction words) of ram ascode memory, with a separate 1kb (512 word) data space. dsp code memory code memory for the dspcore is implemented as an8kb block of static ram. following power-on reset, the dspcore cpu is disabled (that is, endsp is clear). since the dspcore is not fetching instructions, its code memory can be remapped to the usercore data space. the dspcore code ram is mapped into usercore data space at 0x1000?x2fff in byte mode (or 0x1000?x1fff in word mode). code for the dspcore must be compiled along with the code for the usercore as an independent, self-con- tained module. that is, the dspcore code cannot con- tain calls to modules in the usercore and cannot depend on any c runtime code that is executed only in the usercore. for this reason, it is likely that develop- ment for the dspcore is done in assembly language rather than c. code for the dspcore must be compiled to run at location 0x8000 and must be located in a seg- ment with a known absolute address. to configure dsp code memory at runtime using the utility rom copy routines: establish a word array at location 0x1000. establish a word pointer (dp[0]) at the start of the dspcore code block in flash. add 0x8000 to dp[0]. call the utility rom function urom_movedpinc. copy the result to the word array and increment the array pointer. repeat until complete. once the copy is complete, setting the endsp bit relo- cates the ram block from 0x1000 in usercore data space to 0x8000 in dspcore code space and releases dspcore reset. when dspcore reset is released, the dspcore begins executing instructions from the ram block at 0x8000. intercore communications a set of five registers is used to communicate betweenthe usercore and the dspcore. three registers, mreq0, mreq1 and mreq2, are dedicated to com- municating requests from the usercore to the dspcore; two registers, srsp0 and srsp1, manage responses from the dspcore to the usercore. the usercore starts all communication between the two cores. typically, the usercore and the dspcore agree on a set of 4-bit request codes that the dspcore recog- nizes and to which it responds. for example, requestcode 1 might be a software reset; request code 2 might be a read ram request; request code 3 might be a write ram request. a set of hardware locks keep the two cores in synchro- nization for purposes of communication. the reqcdv (request command data valid) bit in the mreq0 is set by the usercore to alert the dspcore that a request is pending. when the dspcore has read the request, it can clear the reqcdv bit. only the dspcore can clear the bit; thus, coherency is guaranteed. similarly, when the dspcore has a response available it sets the rspsdv (response status data valid). when the usercore has received the response data, it clears the rspsdv bit. since only the dspcore can set this bit and only the usercore can clear it, once again, coherency is guaranteed. a typical use-case scenario would proceed as follows. case 1: load the 16-bit value 0x55aa to ram loca- tion 0x0020 in the dspcore. it has been established that the command for ram write is 0x03. 1) the usercore loads the 16-bit address 0x0020 into mreq1 and the 16-bit data word 0x55aa intomreq2. 2) the usercore loads 0x23 into the mreq0 register. this simultaneously loads the command 0x03 intothe request command and sets the reqcdv bit to alert the dspcore that a command is pending. 3) the dspcore receives the alert that a command is pending and retrieves the command from themreq0 register. it decodes the request as a ram write request (0x03.) in response, it reads mreq1 for the address and mreq2 for the data to write. 4) the dspcore completes the ram write operation. 5) the dspcore then clears the reqcdv bit in the mreq0 register to signal the successful executionof the command. case 2: read the 16-bit value at dspcore ram loca-tion 0x0030. it has been established that the com- mand for ram read is 0x02. 1) the usercore loads the 16-bit address 0x0030 into mreq1. 2) the usercore loads 0x22 into the mreq0 register. this action simultaneously loads the command0x02 into the request command and sets the reqcdv bit to alert the dspcore that a command is pending. 3) the dspcore receives the alert that a command is pending and retrieves the command from the downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 61 mreq0 register. it decodes the request as a ramread request (0x02.) in response, it reads mreq1 for the address to read. 4) the dspcore completes the ram read operation. 5) the dspcore loads the results of the read to the srsp1 register. 6) the dspcore loads 0x22 into the srsp0 register. this action simultaneously loads the response 0x02into the response bits and sets the rspsdv bit to alert the usercore that a response is pending. 7) the usercore receives the response alert and retrieves the response from the srsp1 register. itthen clears the rspsdv bit in the srsp0 register. 8) the dspcore sees that the rspsdv bit is cleared. it then clears the reqcdv bit in the mreq0 register. 9) the usercore sees the reqcdv bit go clear and is now ready for the next request. timer 2 timer 2 is a complex timing element designed for pwmgeneration, ir generation and detection, and a variety of other purposes. for information about this timer and its properties, refer to section 9 of the maxq family user? guide . timer b the timer b peripheral is an enhanced timer type 1(refer to the maxq family user? guide for information about type 0, type 1, and type 2 timers). it has many ofthe features of the more complex type 2 timer, but with an interface optimized for the 16-bit maxq architecture. timer b is managed through four 16-bit registers: tb0cn is the configuration and status register; tb0v is the current value of the timer; tb0r is the capture/reload register; and tb0c is the compare register. the bits of the configuration and status register are as follows: bit 0: cp/ rlb . if cleared to 0, tb0r functions as a reload register. this means that tb0v is reloaded withthe appropriate value when overflow/underflow occurs. (if counting up, tb0v is loaded with 0 when tb0v = tb0r; if counting down, tb0v is loaded with tb0r when tb0v = 0x0000.) if set, the tb0r captures the value of tb0v when a falling edge is detected on tbb. bit 1: etb. enables all interrupts from timer b. bit 2: trb. when set, timer b is allowed to run. when cleared, the time is halted with its current state intact. bit 3: exenb. setting this bit enables capture/reload functions on the tbb external pin. in capture mode, anegative transition on this pin copies the current value of the tb0v register into the tb0r register. in reload mode, a negative transition on this pin resets tb0v to 0 (in upcount mode) or to tb0r (in downcount mode). bit 4: dcen. when clear, the counter or timer counts up. when set, the counter or timer counts either up ordown depending on the state of the tbb pin. in pwm modes, the tbb pin is an output; in this case, when dcen is active the counter counts up to tb0r, then counts down to 0 and repeats. bit 5: tboe. when set, and when the timer is operating in timer mode, this bit enables the output of the timeronto the tba pin. when clear, the tba pin can be used for an alternate function, or as an input to the timer. bit 6: exfb. this flag is used to trigger an interrupt on any of the following conditions: the timer is configured as a timer in capture mode, and a negative edge on the tbb pin is observed withthe tbb pin enabled. the timer is configured in reload mode and counts up, and a negative edge on the tbb pin is observedwith the tbb pin enabled. the timer is configured to any pwm operating mode and a negative edge on the tbb pin is observed withthe tbb pin enabled. additionally, if reload mode is in effect with no pwmoperating mode, the exfb bit toggles on overflow/ underflow without generating an interrupt. bit 7: tfb. this flag is set on any overflow/underflow event. it must be cleared by software.bits 10 to 8: tbps. these three bits define the prescaler divisor: value divisor 000 1 001 4 010 16 011 64 100 256 101 1024 110 1 111 1 downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller 62 ______________________________________________________________________________________ bit 11: tbcr. setting this bit enables pwm mode. if this bit is set (and tbcs is clear), the tbb pin is drivento 0 when tb0v = tb0c and driven to 1 when tb0v = tb0r. setting both tbcs and tbcr causes tbb to tog- gle when tb0v = tb0c. bit 12: tbcs. setting this bit enables pwm mode. if this bit is set (and tbcr is clear), the tbb pin is drivento 1 when tb0v = tb0c and driven to 0 when tb0v = tb0r. setting both tbcs and tbcr causes tbb to tog- gle when tb0v = tb0c. bit 15: c/ t b. when clear, the timer is configured as a timer (that is, it counts clock pulses from the prescaledsystem clock.) when set, the timer is configured as a counter; that is, it counts transitions on the tba pin. timer b use-case scenarios case 1: output 1khz square wave on tba.in this instance, reload the timer at a 500? interval (since a 1khz square wave has an edge every 500?. since the default usercore clock is 5.014mhz, the total divisor should be 5014khz/2khz = 2507. thus, a prescaler value of 1 and a tb0r value of 2507 (0x09cb) provides the necessary timing. the procedure is as follows: load tb0r with 0x09cb. load tb0cn with 0x0024. this (1) sets the timer to timer mode, (2) disables pwm mode, (3) sets aprescaler divisor of 1, (4) disables the txfb trigger, (5) enables square-wave output, (6) sets reload mode, and (7) disables any interrupts in the timer. case 2: configure a pwm output with one part in1000 resolution. frequency is not critical. in this instance, configure tb0r with a value of 1000. configure tb0cn with 0x0804. this (1) sets the timer to timer mode, (2) enables pwm mode, (3) sets a prescaler divisor of 1, (4) disables the txfb trigger, (5) disables square-wave output, (6) sets reload mode, and (7) disables interrupts. writing a value to tb0c sets the duty cycle of the output on tbb. when the tb0c value is 100, for example, the timer counts from 0 to 99 with the output high. when the timer reaches 100, the tb0c value is a match and the output goes low. the timer continues to run until it reach- es 1000, at which time it switches low and reloads to 0. multiply-accumulate unit the MAXQ3108 contains one multiply-accumulate unitfor each cpu core. each of these units can multiply two 16-bit numbers (signed or unsigned) in a single cpu cycle, and then accumulate the result to a 48-bit accu- mulator in a second cycle. details on the multiply-accu- mulate units are available in section 12 of the maxq family user? guide . real-time clock the real-time clock is a 32-bit time-of-day clock thatsupports interrupt generation based on time intervals and time-of-day alarms. it is driven from the 32,768hz crystal oscillator and operates even when the usercore is in stop mode. for information on the real-time clock module, refer to section 14 of the maxq family user? guide . programmable pulse generators the dspcore has access to two precision, programma-ble pulse generators. pulse generation is critical in electricity meters and other utility-based applications. the principle of the pulse generator is simple: an output port is conditioned on a 22-bit counter so that when the counter is 0, the output port operates normally (that is, when a bit value is written to the port, the state of the pin changes); but when the counter is running, the pin is held at its previous state regardless of what value is written to it. the moment the counter reaches 0, howev- er, the new value is transferred to the pin. to use the pulse generator, write a 1 to the port and write a value to the counter. the counter begins count- ing down. while the counter is running, write a 0 to the port. because the counter is running, the 0 is not imme- diately reflected on the pin. only when the counter reaches 0 does the ??level transfer to the pin. the practical value of this is the amount of time that the pin has been high is exactly a function of the value written to the counter. in the MAXQ3108, the counter is 22 bits wide, but only the high-order 16 bits are writable. the other 6 bits are cleared on any write. thus, the maximum value that can be written to the register is 0x3fffc0, or, at the default clock rate of the dspcore (10.027mhz) about 418ms. downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller ______________________________________________________________________________________ 63 in-application flash programming from user code, flash is programmed using the romutility functions from either c or assembly language. the flash can be programmed one word at a time if so desired. once a new user code routine has been pro- grammed and verified in flash, the link or call address to that routine can be enabled. this procedure allows continued user code execution while dynamic reconfig- uration of user billing code and tariff schedules occurs. the initial application code loaded through jtag dic- tates the in-application facility and implements recogni- tion of the in-application request and communication. the following function declarations show examples of some of the rom utility functions provided for in-appli- cation flash programming. /* write one 16-bit word to code address 'dest'. * dest must be aligned to 16 bits. * returns 0 = failure, 1 = ok. */ int flash_write (uint16_t dest, uint16_t data); to erase, the following function would be used: /* erase the given flash page * addr: flash offset (anywhere within page) */ int flash_erasepage(uint16_t addr); development and technical support a variety of highly versatile, affordably priced develop-ment tools for this microcontroller are available from maxim and third-party suppliers, including: compilers in-circuit emulators integrated development environments (ides) jtag-to-serial converters for programming and debugging a partial list of development tool vendors can be foundon our website at www.maxim-ic.com/maxq_tools . for technical support, go to https://support.maxim- ic.com/micro . additional documentation designers must have three documents to fully use allthe features of this device. this data sheet contains pin descriptions, feature overviews, and electrical specifi- cations. errata sheets contain deviations from pub- lished specifications. the maxq family user? guide offers detailed information about device features andoperation. this MAXQ3108 data sheet, which contains electri- cal/timing specifications and pin descriptions. the MAXQ3108 errata sheet for the specific device revision, available at www.maxim-ic.com/errata . the maxq family user's guide , which contains detailed information on core features and operation,including programming. this document is available on our website at www.maxim-ic.com/maxqug . downloaded from: http:///
MAXQ3108 low-power, dual-core microcontroller maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim product. no circuit patent licenses are implied. maxim reserves the right to change the circuitry and specifications without notice at any time. 64 ____________________maxim integrated products, 120 san gabriel drive, sunnyvale, ca 94086 408-737-7600 2009 maxim integrated products maxim is a registered trademark of maxim integrated products, inc. top view tssop 25 4 p2.4/mdin0p p0.2/mdin1n/t2p/int2 26 3 p2.3/mdin0n/ssel p0.1/rxd0/int1 27 2 p2.2/sclk/clko p0.0/txd0/int0 28 1 p2.1/mdin2n/miso p2.0/mdin2p/mosi 22 7 p0.7/rxd1/int7 p0.5/scl/int5 23 6 p0.6/txd1/int6 p0.4/sda/int4 21 8 v dd p2.5/cf1 20 9 regout p2.6/cf2 19 10 v bat p1.0/tms/int8 18 11 p1.5/tba p1.1/tck/int9 17 12 gnd p1.2/tdi/int10 16 13 cx2 p1.3/tdo/sqw/int11 24 5 p1.6/rst p0.3/mdin1p/t2pb/int3 15 14 cx1 p1.4/tbb MAXQ3108 package type package code document no. 28 tssop u28+2 21-0066 package information for the latest package outline information and land patterns, go to www.maxim-ic.com/packages . pin configuration downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of MAXQ3108

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X